#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: |
Description
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)
Change History (4)
Changed 14 years ago by
Attachment: | ui.datepicker.week-fix.diff added |
---|
comment:1 Changed 14 years ago by
Bump!
This fix is also needed for week displaying: http://dev.jqueryui.com/ticket/4131
Diff