diff options
author | Keith Wood <kbwood.au@gmail.com> | 2008-07-23 10:35:33 +0000 |
---|---|---|
committer | Keith Wood <kbwood.au@gmail.com> | 2008-07-23 10:35:33 +0000 |
commit | 323399c7bfc13c81dbaf780bd11615f04c288ab1 (patch) | |
tree | 12143f4d97d4327b43b7cf3fc39d713412892ca2 /ui/ui.datepicker.js | |
parent | d1083005b44ec515e12ff09b7523da53442ef72b (diff) | |
download | jquery-ui-323399c7bfc13c81dbaf780bd11615f04c288ab1.tar.gz jquery-ui-323399c7bfc13c81dbaf780bd11615f04c288ab1.zip |
Fixed 3105 First week in November day repeat
Fixed 3088 Repeating date in October 2008
Diffstat (limited to 'ui/ui.datepicker.js')
-rw-r--r-- | ui/ui.datepicker.js | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/ui/ui.datepicker.js b/ui/ui.datepicker.js index b0564cb94..59bd9492a 100644 --- a/ui/ui.datepicker.js +++ b/ui/ui.datepicker.js @@ -1328,7 +1328,9 @@ $.extend(Datepicker.prototype, { if (drawYear == inst.selectedYear && drawMonth == inst.selectedMonth) inst.selectedDay = Math.min(inst.selectedDay, daysInMonth); var leadDays = (this._getFirstDayOfMonth(drawYear, drawMonth) - firstDay + 7) % 7; - var printDate = new Date(drawYear, drawMonth, 1 - leadDays); + var tzDate = new Date(drawYear, drawMonth, 1 - leadDays); + var utcDate = new Date(drawYear, drawMonth, 1 - leadDays); + var printDate = utcDate; 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">' + @@ -1366,7 +1368,9 @@ $.extend(Datepicker.prototype, { inst.id + '\',' + drawMonth + ',' + drawYear + ', this);"') + '>' + // actions (otherMonth ? (showOtherMonths ? printDate.getDate() : ' ') : // display for other months (unselectable ? printDate.getDate() : '<a>' + printDate.getDate() + '</a>')) + '</td>'; // display for this month - printDate.setUTCDate(printDate.getUTCDate() + 1); + tzDate.setDate(tzDate.getDate() + 1); + utcDate.setUTCDate(utcDate.getUTCDate() + 1); + printDate = (tzDate > utcDate ? tzDate : utcDate); } html += '</tr>'; } |