Side navigation
#3570 closed bug (invalid)
Opened November 03, 2008 06:53PM UTC
Closed November 06, 2008 09:51PM UTC
UI.DatePicker has duplicate date
Reported by: | camoire | Owned by: | |
---|---|---|---|
Priority: | major | Milestone: | 1.3 |
Component: | plugin | Version: | 1.2.6 |
Keywords: | ui datepicker | Cc: | |
Blocked by: | Blocking: |
Description
The UI.DatePicker plugin has a duplicate day in the first full week of November. This happens for every year and can be seen in any of the demos for the datepicker.
Attachments (0)
Change History (3)
Changed November 03, 2008 07:41PM UTC by comment:1
Changed November 06, 2008 09:06PM UTC by comment:2
The problem is daylight savings time. The Date object sets the year,month and day, but with no time specified defaults to midnight. So when the time increments by 1 day, and then daylight savings sets it back 1 hour, you get two November 2 on the calendar. Include a time greater than 1 when the date object is created and problem is solved.
Change line 1272 in ui.datepicker.js or line 5801 in jquery.ui.all.js from:
var printDate = new Date(drawYear, drawMonth, 1 - leadDays);
to:
var printDate = new Date(drawYear, drawMonth, 1 - leadDays,12);
Changed November 06, 2008 09:51PM UTC by comment:3
resolution: | → invalid |
---|---|
status: | new → closed |
This belongs to the UI Bug Tracker.
I am seeing this behavior after the first Sunday in November as well as some odd behavior after the second Sunday in March (date selected state no longer works after that Sunday). As it turns out, these are the times of the year when we (US) change our clocks forward and back.
Bug also appears to be in release 1.5.2 (stable). I'm not sure about 1.6rc2.