diff --git a/ui/ui.datepicker.js b/ui/ui.datepicker.js index 4a5447671..9549712b0 100644 --- a/ui/ui.datepicker.js +++ b/ui/ui.datepicker.js @@ -80,6 +80,7 @@ function Datepicker() { mandatory: false, // True to hide the Clear link, false to include it hideIfNoPrevNext: false, // True to hide next/previous month links // if not applicable, false to just disable them + navigationAsDateFormat: false, // True if date formatting applied to prev/today/next links changeMonth: true, // True if month can be selected directly, false if only prev/next changeYear: true, // True if year can be selected directly, false if only prev/next yearRange: '-10:+10', // Range of years to display in drop-down, @@ -1132,6 +1133,7 @@ $.extend(DatepickerInstance.prototype, { var prompt = this._get('prompt'); var closeAtTop = this._get('closeAtTop'); var hideIfNoPrevNext = this._get('hideIfNoPrevNext'); + var navigationAsDateFormat = this._get('navigationAsDateFormat'); var numMonths = this._getNumberOfMonths(); var stepMonths = this._get('stepMonths'); var isMultiMonth = (numMonths[0] != 1 || numMonths[1] != 1); @@ -1152,23 +1154,30 @@ $.extend(DatepickerInstance.prototype, { } } // controls and links + var prevText = this._get('prevText'); + prevText = (!navigationAsDateFormat ? prevText : $.datepicker.formatDate( + prevText, new Date(drawYear, drawMonth - stepMonths, 1), this._getFormatConfig())); var prev = '