mirror of
https://github.com/jquery/jquery-ui.git
synced 2024-10-05 01:44:18 +00:00
Datepicker: Only generate yearshtml once. Fixes #7176 - Datepicker shows only single year in year dropdown if numberOfMonths > 1.
(cherry picked from commit 98c53d8432
)
This commit is contained in:
parent
8310d185b3
commit
a8fc3da628
2
ui/jquery.ui.datepicker.js
vendored
2
ui/jquery.ui.datepicker.js
vendored
@ -1575,6 +1575,7 @@ $.extend(Datepicker.prototype, {
|
|||||||
if (!showMonthAfterYear)
|
if (!showMonthAfterYear)
|
||||||
html += monthHtml + (secondary || !(changeMonth && changeYear) ? ' ' : '');
|
html += monthHtml + (secondary || !(changeMonth && changeYear) ? ' ' : '');
|
||||||
// year selection
|
// year selection
|
||||||
|
if ( !inst.yearshtml ) {
|
||||||
inst.yearshtml = '';
|
inst.yearshtml = '';
|
||||||
if (secondary || !changeYear)
|
if (secondary || !changeYear)
|
||||||
html += '<span class="ui-datepicker-year">' + drawYear + '</span>';
|
html += '<span class="ui-datepicker-year">' + drawYear + '</span>';
|
||||||
@ -1611,6 +1612,7 @@ $.extend(Datepicker.prototype, {
|
|||||||
html += '<select class="ui-datepicker-year"><option value="' + drawYear + '" selected="selected">' + drawYear + '</option></select>';
|
html += '<select class="ui-datepicker-year"><option value="' + drawYear + '" selected="selected">' + drawYear + '</option></select>';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
html += this._get(inst, 'yearSuffix');
|
html += this._get(inst, 'yearSuffix');
|
||||||
if (showMonthAfterYear)
|
if (showMonthAfterYear)
|
||||||
html += (secondary || !(changeMonth && changeYear) ? ' ' : '') + monthHtml;
|
html += (secondary || !(changeMonth && changeYear) ? ' ' : '') + monthHtml;
|
||||||
|
Loading…
Reference in New Issue
Block a user