From 5ec53d2c2cf1d68945d89722c628ba8816235cc5 Mon Sep 17 00:00:00 2001 From: Keith Wood Date: Fri, 18 Jul 2008 09:23:10 +0000 Subject: Fixed 3084 Arrange order of month and year selectboxes --- ui/ui.datepicker.js | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) (limited to 'ui') diff --git a/ui/ui.datepicker.js b/ui/ui.datepicker.js index 0e7c4cb95..8ec7d7de9 100644 --- a/ui/ui.datepicker.js +++ b/ui/ui.datepicker.js @@ -84,6 +84,7 @@ function Datepicker() { gotoCurrent: false, // True if today link goes back to current selection instead 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 + monthAfterYear: false, // True if the year select precedes month, false for month then year yearRange: '-10:+10', // Range of years to display in drop-down, // either relative to current year (-nn:+nn) or absolute (nnnn:nnnn) changeFirstDay: true, // True to click on day name to change, false to remain as set @@ -1370,26 +1371,30 @@ $.extend(Datepicker.prototype, { _generateMonthYearHeader: function(inst, drawMonth, drawYear, minDate, maxDate, selectedDate, secondary, showStatus, initStatus, monthNames) { minDate = (inst.rangeStart && minDate && selectedDate < minDate ? selectedDate : minDate); + var monthAfterYear = this._get(inst, 'monthAfterYear'); var html = '
'; + var monthHtml = ''; // month selection if (secondary || !this._get(inst, 'changeMonth')) - html += monthNames[drawMonth] + ' '; + monthHtml += monthNames[drawMonth] + ' '; else { var inMinYear = (minDate && minDate.getFullYear() == drawYear); var inMaxYear = (maxDate && maxDate.getFullYear() == drawYear); - html += ''; + monthHtml += ''; } + if (!monthAfterYear) + html += monthHtml; // year selection if (secondary || !this._get(inst, 'changeYear')) html += drawYear; @@ -1422,6 +1427,8 @@ $.extend(Datepicker.prototype, { } html += ''; } + if (monthAfterYear) + html += monthHtml; html += '
'; // Close datepicker_header return html; }, -- cgit v1.2.3