aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKeith Wood <kbwood.au@gmail.com>2010-01-10 04:54:12 +0000
committerKeith Wood <kbwood.au@gmail.com>2010-01-10 04:54:12 +0000
commitc14e9589666efa88d6c39d849ea92546131e85b7 (patch)
treeb61b9b8c5a00d23cd00b8485f0c135394900038f
parent6047f99ec4bea69db2422f5a393501daf1408c9a (diff)
downloadjquery-ui-c14e9589666efa88d6c39d849ea92546131e85b7.tar.gz
jquery-ui-c14e9589666efa88d6c39d849ea92546131e85b7.zip
Datepicker: Fixed #4804 onChangeMonthYear fires at first run
-rw-r--r--ui/jquery.ui.datepicker.js6
1 files changed, 3 insertions, 3 deletions
diff --git a/ui/jquery.ui.datepicker.js b/ui/jquery.ui.datepicker.js
index 428a24043..437dca283 100644
--- a/ui/jquery.ui.datepicker.js
+++ b/ui/jquery.ui.datepicker.js
@@ -259,7 +259,7 @@ $.extend(Datepicker.prototype, {
return this._get(inst, key);
});
$.data(target, PROP_NAME, inst);
- this._setDate(inst, this._getDefaultDate(inst));
+ this._setDate(inst, this._getDefaultDate(inst), true);
this._updateDatepicker(inst);
this._updateAlternate(inst);
},
@@ -1302,7 +1302,7 @@ $.extend(Datepicker.prototype, {
},
/* Set the date(s) directly. */
- _setDate: function(inst, date) {
+ _setDate: function(inst, date, noChange) {
var clear = !(date);
var origMonth = inst.selectedMonth;
var origYear = inst.selectedYear;
@@ -1310,7 +1310,7 @@ $.extend(Datepicker.prototype, {
inst.selectedDay = inst.currentDay = date.getDate();
inst.drawMonth = inst.selectedMonth = inst.currentMonth = date.getMonth();
inst.drawYear = inst.selectedYear = inst.currentYear = date.getFullYear();
- if (origMonth != inst.selectedMonth || origYear != inst.selectedYear)
+ if ((origMonth != inst.selectedMonth || origYear != inst.selectedYear) && !noChange)
this._notifyChange(inst);
this._adjustInstDate(inst);
if (inst.input) {