Opened 14 years ago

Closed 14 years ago

Last modified 10 years ago

#3522 closed bug (fixed)

Datepicker - Daylight Savings

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


Calendar repeats November the 2nd for Sunday and Monday. This is where the daylight savings time switch occurs.

Change History (4)

comment:1 Changed 14 years ago by kbwood

Resolution: fixed
Status: newclosed

Fixed in 1.6.

comment:2 Changed 14 years ago by pjesi

What about the stable 1.5.x? Should critical fix like this not go into versions that are in production???

comment:3 Changed 14 years ago by pdc

I too found myself in need of a fix for v1.5.2 of the Datepicker. My quick fix was to add 6 hours to the initial value of printDate:

Index: C:/Apache Sites/Default/ds/sites/all/modules/jquery_ui/jquery.ui/ui/ui.datepicker.js
--- C:/Apache Sites/Default/ds/sites/all/modules/jquery_ui/jquery.ui/ui/ui.datepicker.js	(revision 880)
+++ C:/Apache Sites/Default/ds/sites/all/modules/jquery_ui/jquery.ui/ui/ui.datepicker.js	(working copy)
@@ -1270,6 +1270,7 @@
 					inst.selectedDay = Math.min(inst.selectedDay, daysInMonth);
 				var leadDays = (this._getFirstDayOfMonth(drawYear, drawMonth) - firstDay + 7) % 7;
 				var printDate = new Date(drawYear, drawMonth, 1 - leadDays);
+				printDate.setHours(6); // <--- changed
 				var numRows = (isMultiMonth ? 6 : Math.ceil((leadDays + daysInMonth) / 7)); // calculate the number of rows to generate
 				for (var dRow = 0; dRow < numRows; dRow++) { // create date picker rows
 					html += '<tr class="ui-datepicker-days-row">' +

The problem was caused by the fact that the last day of daylight savings is 25 hours long, so adding 24h left it pointing to the same day.

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

Milestone: TBD

Milestone TBD deleted

Note: See TracTickets for help on using tickets.