aboutsummaryrefslogtreecommitdiffstats
path: root/ui/ui.datepicker.js
diff options
context:
space:
mode:
authorKeith Wood <kbwood.au@gmail.com>2009-06-22 02:08:19 +0000
committerKeith Wood <kbwood.au@gmail.com>2009-06-22 02:08:19 +0000
commit35a4052aba3211a95a64391c06b28f533d337d4e (patch)
tree633eb2367e133fcc7c29e9d27e0325580b72ccb4 /ui/ui.datepicker.js
parent3b5c91fdc668bd02cfb0293cf167f05a5c5b4b86 (diff)
downloadjquery-ui-35a4052aba3211a95a64391c06b28f533d337d4e.tar.gz
jquery-ui-35a4052aba3211a95a64391c06b28f533d337d4e.zip
Datepicker: Fixed #4536 Datepicker maxDate doesn't take into account column layout
Diffstat (limited to 'ui/ui.datepicker.js')
-rw-r--r--ui/ui.datepicker.js6
1 files changed, 3 insertions, 3 deletions
diff --git a/ui/ui.datepicker.js b/ui/ui.datepicker.js
index f3f00acb3..702d5ee8e 100644
--- a/ui/ui.datepicker.js
+++ b/ui/ui.datepicker.js
@@ -1296,7 +1296,7 @@ $.extend(Datepicker.prototype, {
}
if (maxDate) {
var maxDraw = this._daylightSavingAdjust(new Date(maxDate.getFullYear(),
- maxDate.getMonth() - numMonths[1] + 1, maxDate.getDate()));
+ maxDate.getMonth() - (numMonths[0] * numMonths[1]) + 1, maxDate.getDate()));
maxDraw = (minDate && maxDraw < minDate ? minDate : maxDraw);
while (this._daylightSavingAdjust(new Date(drawYear, drawMonth, 1)) > maxDraw) {
drawMonth--;
@@ -1554,8 +1554,8 @@ $.extend(Datepicker.prototype, {
/* Determines if we should allow a "next/prev" month display change. */
_canAdjustMonth: function(inst, offset, curYear, curMonth) {
var numMonths = this._getNumberOfMonths(inst);
- var date = this._daylightSavingAdjust(new Date(
- curYear, curMonth + (offset < 0 ? offset : numMonths[1]), 1));
+ var date = this._daylightSavingAdjust(new Date(curYear,
+ curMonth + (offset < 0 ? offset : numMonths[0] * numMonths[1]), 1));
if (offset < 0)
date.setDate(this._getDaysInMonth(date.getFullYear(), date.getMonth()));
return this._isInRange(inst, date);