#640 closed defect (fixed)
dojo.date.fromSql (wrong month due to improper use of parseInt) - Bug in changeset 3595
Reported by: | Owned by: | Tom Trenka | |
---|---|---|---|
Priority: | high | Milestone: | |
Component: | General | Version: | 0.3 |
Keywords: | Cc: | ||
Blocked By: | Blocking: |
Description
Hi,
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.
Note: See
TracTickets for help on using
tickets.
Committed as changeset #3657.