mirror of
https://github.com/jquery/jquery-ui.git
synced 2024-11-21 11:04:24 +00:00
Datepicker: Fixed #4804 onChangeMonthYear fires at first run
This commit is contained in:
parent
6047f99ec4
commit
c14e958966
6
ui/jquery.ui.datepicker.js
vendored
6
ui/jquery.ui.datepicker.js
vendored
@ -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) {
|
||||
|
Loading…
Reference in New Issue
Block a user