Opened 16 years ago

Closed 16 years ago

Last modified 15 years ago

#640 closed defect (fixed) (wrong month due to improper use of parseInt) - Bug in changeset 3595

Reported by: [email protected] Owned by: Tom Trenka
Priority: high Milestone:
Component: General Version: 0.3
Keywords: Cc:
Blocked By: Blocking:



Changeset 3595 was submitted to fix ticket #519, an excerpt from the code:

return new Date(parts[0], (parseInt(parts[1])-1), parts[2], parts[3], parts[4], parts[5]);

A better fix would be:

return new Date(parts[0], (parseInt(parts[1], 10)-1), parts[2], parts[3], parts[4], parts[5]);

This is because months after a date such as 2006-08-01 will get parsed incorrectly as a leading zero in front of a parseInt'ed string will result in it being parsed as a base 8 numeral instead of a base 10 one.

Thank you and have a nice day.

Change History (2)

comment:1 Changed 16 years ago by Tom Trenka

Resolution: fixed
Status: newclosed

Committed as changeset #3657.

comment:2 Changed 15 years ago by (none)

Milestone: 0.3release

Milestone 0.3release deleted

Note: See TracTickets for help on using tickets.