Opened 14 years ago

Closed 14 years ago

Last modified 10 years ago

#4285 closed bug (fixed)

Week of the Year off by one during daylight saving time

Reported by: scarstens Owned by:
Priority: minor Milestone:
Component: ui.datepicker Version:
Keywords: Cc:
Blocked by: Blocking:


If you enable the display of the week in datepicker and switch to march 2009. DST starts at the end of march in germany. The Week 13 will be display double. At the end of the year the Weeks realign with reality when DST ends.

The difference between the selected date and the first day of the first week is calculated. Then this is devided by 7 to get the week number. If there is a change in the timezone between these dates the difference in days will be with a fraction (9.95). The end result is rounded with Math.floor but the intermediate step for the days has to be rounded with Math.round

Math.floor(((checkDate - firstMon) / 86400000) / 7) + 1;

needs to be

Math.floor(Math.round((checkDate - firstMon) / 86400000) / 7) + 1;

diff attached

Attachments (1)

ui.datepicker.week-fix.diff (401 bytes) - added by scarstens 14 years ago.

Download all attachments as: .zip

Change History (4)

Changed 14 years ago by scarstens

Attachment: ui.datepicker.week-fix.diff added


comment:1 Changed 14 years ago by hub


This fix is also needed for week displaying:

comment:2 Changed 14 years ago by kbwood

Resolution: fixed
Status: newclosed

Fixed in r2423.

comment:3 Changed 10 years ago by Scott González

Milestone: TBD

Milestone TBD deleted

Note: See TracTickets for help on using tickets.