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 Nicklas Nordborg, 12 years ago

Status: newassigned

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 to parseInt. http://www.w3schools.com/jsref/jsref_parseInt.asp

I think we should do that everywhere in our code that use parseInt because there is no place that should use anything but regular numbers.

comment:2 by Nicklas Nordborg, 12 years ago

Resolution: fixed
Status: assignedclosed

(In [1726]) Fixes #418: Dates are not parsed correctly by the sample report generator

Hope this doesn't break some other wizard...

Note: See TracTickets for help on using tickets.