diff options
author | Adam Parod <mystic414@gmail.com> | 2011-02-17 15:17:40 -0600 |
---|---|---|
committer | Scott González <scott.gonzalez@gmail.com> | 2011-03-07 09:34:00 -0500 |
commit | 74b7c3f684f5d83effcee6d5099c6fffb020fdf9 (patch) | |
tree | 2c2152d6ae850d61936b61d1d1ad81c612edb85a /ui/jquery.ui.datepicker.js | |
parent | f1d939bc589fd8d211e0dc540f7d92cfae94a411 (diff) | |
download | jquery-ui-74b7c3f684f5d83effcee6d5099c6fffb020fdf9.tar.gz jquery-ui-74b7c3f684f5d83effcee6d5099c6fffb020fdf9.zip |
Datepicker: Reformat minDate/maxDate when dateFormat changes. Fixes #7009 - Reformat minDate/maxDate when dateFormat changes.
Diffstat (limited to 'ui/jquery.ui.datepicker.js')
-rw-r--r-- | ui/jquery.ui.datepicker.js | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/ui/jquery.ui.datepicker.js b/ui/jquery.ui.datepicker.js index c23984530..8dd9bf3dc 100644 --- a/ui/jquery.ui.datepicker.js +++ b/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); |