aboutsummaryrefslogtreecommitdiffstats
path: root/ui/ui.datepicker.js
diff options
context:
space:
mode:
authorKeith Wood <kbwood.au@gmail.com>2008-08-02 04:02:37 +0000
committerKeith Wood <kbwood.au@gmail.com>2008-08-02 04:02:37 +0000
commitd3b3c596162983bc010faaf885fb6433809af255 (patch)
tree59e9ff462be5db0d508fc6c011e169423637ea7c /ui/ui.datepicker.js
parent869b6f03b03219b9886cfd913837bd17aa05236a (diff)
downloadjquery-ui-d3b3c596162983bc010faaf885fb6433809af255.tar.gz
jquery-ui-d3b3c596162983bc010faaf885fb6433809af255.zip
Fixed 3116 Incorrect handling of change of range select
Diffstat (limited to 'ui/ui.datepicker.js')
-rw-r--r--ui/ui.datepicker.js15
1 files changed, 13 insertions, 2 deletions
diff --git a/ui/ui.datepicker.js b/ui/ui.datepicker.js
index bc4ca9b55..eafc8ff05 100644
--- a/ui/ui.datepicker.js
+++ b/ui/ui.datepicker.js
@@ -399,7 +399,18 @@ $.extend(Datepicker.prototype, {
settings[name] = value;
}
if (inst = $.data(target, PROP_NAME)) {
+ if (this._curInst == inst) {
+ this._hideDatepicker(null);
+ }
extendRemove(inst.settings, settings);
+ var date = new Date();
+ extendRemove(inst, {rangeStart: null, // start of range
+ endDay: null, endMonth: null, endYear: null, // end of range
+ selectedDay: date.getDate(), selectedMonth: date.getMonth(),
+ selectedYear: date.getFullYear(), // starting point
+ currentDay: date.getDate(), currentMonth: date.getMonth(),
+ currentYear: date.getFullYear(), // current selection
+ drawMonth: date.getMonth(), drawYear: date.getFullYear()}); // month being drawn
this._updateDatepicker(inst);
}
},
@@ -606,7 +617,7 @@ $.extend(Datepicker.prototype, {
@param duration string - the duration over which to close the date picker */
_hideDatepicker: function(input, duration) {
var inst = this._curInst;
- if (!inst)
+ if (!inst || (input && inst != $.data(input, PROP_NAME)))
return;
var rangeSelect = this._get(inst, 'rangeSelect');
if (rangeSelect && inst.stayOpen)
@@ -729,7 +740,7 @@ $.extend(Datepicker.prototype, {
if (rangeSelect) {
inst.stayOpen = !inst.stayOpen;
if (inst.stayOpen) {
- $('.ui-datepicker td').removeClass(this._currentClass);
+ $('.ui-datepicker td', inst.dpDiv).removeClass(this._currentClass);
$(td).addClass(this._currentClass);
}
}