Skip to main content

Search and Top Navigation

#3522 closed bug (fixed)

Opened October 28, 2008 09:11PM UTC

Closed November 03, 2008 12:37AM UTC

Last modified October 11, 2012 09:15PM UTC

Datepicker - Daylight Savings

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

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

Attachments (0)
Change History (4)

Changed November 03, 2008 12:37AM UTC by kbwood comment:1

resolution: → fixed
status: newclosed

Fixed in 1.6.

Changed November 03, 2008 01:56PM UTC by pjesi comment:2

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

Changed November 03, 2008 03:43PM UTC by pdc comment:3

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.

Changed October 11, 2012 09:15PM UTC by scottgonzalez comment:4

milestone: TBD

Milestone TBD deleted