aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKeith Wood <kbwood.au@gmail.com>2008-07-18 09:00:04 +0000
committerKeith Wood <kbwood.au@gmail.com>2008-07-18 09:00:04 +0000
commite139f6ccaafe51ef8e181a6236e713cf64fe2918 (patch)
treec5030704c6b7231cb5e777700ed25f038228ae8f
parent0f1592128fadf1b65d335e0cd34d54a503ea9f89 (diff)
downloadjquery-ui-e139f6ccaafe51ef8e181a6236e713cf64fe2918.tar.gz
jquery-ui-e139f6ccaafe51ef8e181a6236e713cf64fe2918.zip
Fixed 3080 Calls _setDateFromField when inline
Fixed 3082 Arrow keys unnecissarily bound in datepicker Corrected otherMonth class name Corrected getDate for ranges
-rw-r--r--ui/ui.datepicker.js13
1 files changed, 10 insertions, 3 deletions
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 += '<td class="ui-datepicker-days-cell' +
((dow + firstDay + 6) % 7 >= 5 ? ' ui-datepicker-week-end-cell' : '') + // highlight weekends
- (otherMonth ? ' ui-datepicker-otherMonth' : '') + // highlight days from other months
+ (otherMonth ? ' ui-datepicker-other-month' : '') + // highlight days from other months
(printDate.getTime() == selectedDate.getTime() && drawMonth == inst.selectedMonth ?
' ui-datepicker-days-cell-over' : '') + // highlight selected day
(unselectable ? ' ' + this._unselectableClass : '') + // highlight unselectable days