aboutsummaryrefslogtreecommitdiffstats
path: root/ui
diff options
context:
space:
mode:
authorRichard Worth <rdworth@gmail.com>2008-12-31 17:15:47 +0000
committerRichard Worth <rdworth@gmail.com>2008-12-31 17:15:47 +0000
commit043fe4f79d5bd8704ef3b9b12e84885db220c9b7 (patch)
treebddd7af121d618753efe4e82a3827bd5282dd50f /ui
parent51283fbdd8e0061a8438c11596996d0108bbc215 (diff)
downloadjquery-ui-043fe4f79d5bd8704ef3b9b12e84885db220c9b7.tar.gz
jquery-ui-043fe4f79d5bd8704ef3b9b12e84885db220c9b7.zip
Fixed #3712 - Month and year dropdown mis-alignment in datepicker
Diffstat (limited to 'ui')
-rw-r--r--ui/ui.datepicker.js9
1 files changed, 5 insertions, 4 deletions
diff --git a/ui/ui.datepicker.js b/ui/ui.datepicker.js
index a25e72eac..496cdada0 100644
--- a/ui/ui.datepicker.js
+++ b/ui/ui.datepicker.js
@@ -1318,6 +1318,7 @@ $.extend(Datepicker.prototype, {
var dayNamesShort = this._get(inst, 'dayNamesShort');
var dayNamesMin = this._get(inst, 'dayNamesMin');
var monthNames = this._get(inst, 'monthNames');
+ var monthNamesShort = this._get(inst, 'monthNamesShort');
var beforeShowDay = this._get(inst, 'beforeShowDay');
var showOtherMonths = this._get(inst, 'showOtherMonths');
var calculateWeek = this._get(inst, 'calculateWeek') || this.iso8601Week;
@@ -1344,7 +1345,7 @@ $.extend(Datepicker.prototype, {
(/all|left/.test(cornerClass) && row == 0 ? (isRTL ? next : prev) : '') +
(/all|right/.test(cornerClass) && row == 0 ? (isRTL ? prev : next) : '') +
this._generateMonthYearHeader(inst, drawMonth, drawYear, minDate, maxDate,
- selectedDate, row > 0 || col > 0, monthNames) + // draw month headers
+ selectedDate, row > 0 || col > 0, monthNames, monthNamesShort) + // draw month headers
'</div><table class="ui-datepicker-calendar"><thead>' +
'<tr>';
var thead = '';
@@ -1414,7 +1415,7 @@ $.extend(Datepicker.prototype, {
/* Generate the month and year header. */
_generateMonthYearHeader: function(inst, drawMonth, drawYear, minDate, maxDate,
- selectedDate, secondary, monthNames) {
+ selectedDate, secondary, monthNames, monthNamesShort) {
minDate = (inst.rangeStart && minDate && selectedDate < minDate ? selectedDate : minDate);
var changeMonth = this._get(inst, 'changeMonth');
var changeYear = this._get(inst, 'changeYear');
@@ -1436,12 +1437,12 @@ $.extend(Datepicker.prototype, {
(!inMaxYear || month <= maxDate.getMonth()))
monthHtml += '<option value="' + month + '"' +
(month == drawMonth ? ' selected="selected"' : '') +
- '>' + monthNames[month] + '</option>';
+ '>' + monthNamesShort[month] + '</option>';
}
monthHtml += '</select>';
}
if (!showMonthAfterYear)
- html += monthHtml + (secondary || changeMonth || changeYear ? '&#xa0;' : '');
+ html += monthHtml + ((secondary || changeMonth || changeYear) && (!(changeMonth && changeYear)) ? '&#xa0;' : '');
// year selection
if (secondary || !changeYear)
html += '<span class="ui-datepicker-year">' + drawYear + '</span>';