Skip to content
Permalink
Browse files

Datepicker: Reformat minDate/maxDate when dateFormat changes. Fixes #…

…7009 - Reformat minDate/maxDate when dateFormat changes.
  • Loading branch information...
aparod authored and gnarf committed Feb 17, 2011
1 parent 4ad513b commit 18ad8ffb3df0992b2fd241a4602eff5d799dfdc3
Showing with 7 additions and 0 deletions.
  1. +7 −0 ui/jquery.ui.datepicker.js
@@ -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);

0 comments on commit 18ad8ff

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