From e139f6ccaafe51ef8e181a6236e713cf64fe2918 Mon Sep 17 00:00:00 2001 From: Keith Wood Date: Fri, 18 Jul 2008 09:00:04 +0000 Subject: Fixed 3080 Calls _setDateFromField when inline Fixed 3082 Arrow keys unnecissarily bound in datepicker Corrected otherMonth class name Corrected getDate for ranges --- ui/ui.datepicker.js | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'ui/ui.datepicker.js') diff --git a/ui/ui.datepicker.js b/ui/ui.datepicker.js index 1fdae67c9..0e7c4cb95 100644 --- a/ui/ui.datepicker.js +++ b/ui/ui.datepicker.js @@ -373,7 +373,7 @@ $.extend(Datepicker.prototype, { Date[2] - the current dates for a range */ _getDateDatepicker: function(target) { var inst = $.data(target, PROP_NAME); - if (inst) + if (inst && !inst.inline) this._setDateFromField(inst); return (inst ? this._getDate(inst) : null); }, @@ -399,16 +399,22 @@ $.extend(Datepicker.prototype, { +$.datepicker._get(inst, 'stepMonths')), (e.ctrlKey ? 'Y' : 'M')); break; // next month/year on page down/+ ctrl case 35: if (e.ctrlKey) $.datepicker._clearDate(e.target); + handled = e.ctrlKey; break; // clear on ctrl+end case 36: if (e.ctrlKey) $.datepicker._gotoToday(e.target); + handled = e.ctrlKey; break; // current on ctrl+home case 37: if (e.ctrlKey) $.datepicker._adjustDate(e.target, -1, 'D'); + handled = e.ctrlKey; break; // -1 day on ctrl+left case 38: if (e.ctrlKey) $.datepicker._adjustDate(e.target, -7, 'D'); + handled = e.ctrlKey; break; // -1 week on ctrl+up case 39: if (e.ctrlKey) $.datepicker._adjustDate(e.target, +1, 'D'); + handled = e.ctrlKey; break; // +1 day on ctrl+right case 40: if (e.ctrlKey) $.datepicker._adjustDate(e.target, +7, 'D'); + handled = e.ctrlKey; break; // +1 week on ctrl+down default: handled = false; } @@ -1188,7 +1194,8 @@ $.extend(Datepicker.prototype, { var startDate = (!inst.currentYear || (inst.input && inst.input.val() == '') ? null : new Date(inst.currentYear, inst.currentMonth, inst.currentDay)); if (this._get(inst, 'rangeSelect')) { - return [inst.rangeStart || startDate, (!inst.endYear ? null : + return [inst.rangeStart || startDate, + (!inst.endYear ? inst.rangeStart || startDate : new Date(inst.endYear, inst.endMonth, inst.endDay))]; } else return startDate; @@ -1316,7 +1323,7 @@ $.extend(Datepicker.prototype, { (minDate && printDate < minDate) || (maxDate && printDate > maxDate); html += '