Skip to content
Permalink
Browse files
Datepicker: Reformat minDate/maxDate when dateFormat changes. Fixes #…
…7009 - Reformat minDate/maxDate when dateFormat changes.

(cherry picked from commit 74b7c3f)
  • Loading branch information
aparod authored and scottgonzalez committed Mar 7, 2011
1 parent 20b0106 commit 12d38b1886b1e4a17d3bd018f028f7fa2b821229
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 12d38b1

Please sign in to comment.