mirror of
https://github.com/jquery/jquery-ui.git
synced 2024-11-21 11:04:24 +00:00
Datepicker: Reformat minDate/maxDate when dateFormat changes. Fixes #7009 - Reformat minDate/maxDate when dateFormat changes.
(cherry picked from commit 74b7c3f684
)
This commit is contained in:
parent
20b010640e
commit
12d38b1886
7
ui/jquery.ui.datepicker.js
vendored
7
ui/jquery.ui.datepicker.js
vendored
@ -444,7 +444,14 @@ $.extend(Datepicker.prototype, {
|
||||
this._hideDatepicker();
|
||||
}
|
||||
var date = this._getDateDatepicker(target, true);
|
||||
var minDate = this._getMinMaxDate(inst, 'min');
|
||||
var maxDate = this._getMinMaxDate(inst, 'max');
|
||||
extendRemove(inst.settings, settings);
|
||||
// reformat the old minDate/maxDate values if dateFormat changes and a new minDate/maxDate isn't provided
|
||||
if (minDate !== null && settings['dateFormat'] !== undefined && settings['minDate'] === undefined)
|
||||
inst.settings.minDate = this._formatDate(inst, minDate);
|
||||
if (maxDate !== null && settings['dateFormat'] !== undefined && settings['maxDate'] === undefined)
|
||||
inst.settings.maxDate = this._formatDate(inst, maxDate);
|
||||
this._attachments($(target), inst);
|
||||
this._autoSize(inst);
|
||||
this._setDateDatepicker(target, date);
|
||||
|
Loading…
Reference in New Issue
Block a user