Opened 12 years ago
Closed 12 years ago
#418 closed defect (fixed)
Dates are not parsed correctly by the sample report generator
Reported by: | Nicklas Nordborg | Owned by: | Nicklas Nordborg |
---|---|---|---|
Priority: | critical | Milestone: | Reggie v2.9 |
Component: | net.sf.basedb.reggie | Keywords: | |
Cc: |
Description
Try for example to set a report period between 20120701 and 20120930. The wizard gives a "Invalid period" message and refuses to continue. After adding a debug statement it seems like the 20120930 date is parsed to 20111230. The same happens with 20120830, but 20120730 and 20121030 are parsed correctly.
Change History (2)
comment:1 by , 12 years ago
Status: | new → assigned |
---|
comment:2 by , 12 years ago
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
Note:
See TracTickets
for help on using tickets.
Strings that start with '0' are considered by
parseInt
to be octal numbers, it works with '01' to '07' but '08' and '09' are invalid octal numbers and return 0. The solution is to specify the radix as a second argument toparseInt
. http://www.w3schools.com/jsref/jsref_parseInt.aspI think we should do that everywhere in our code that use
parseInt
because there is no place that should use anything but regular numbers.