Skip to content
Permalink
Browse files

Datepicker: Fixed #4804 onChangeMonthYear fires at first run

  • Loading branch information...
Keith Wood
Keith Wood committed Jan 10, 2010
1 parent 6047f99 commit c14e9589666efa88d6c39d849ea92546131e85b7
Showing with 3 additions and 3 deletions.
  1. +3 −3 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,15 +1302,15 @@ $.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;
date = this._restrictMinMax(inst, this._determineDate(inst, date, new Date()));
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) {

0 comments on commit c14e958

Please sign in to comment.
You can’t perform that action at this time.