mirror of
https://github.com/jquery/jquery-ui.git
synced 2024-11-21 11:04:24 +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)
|
||||
html += monthHtml + (secondary || !(changeMonth && changeYear) ? ' ' : '');
|
||||
// year selection
|
||||
if ( !inst.yearshtml ) {
|
||||
inst.yearshtml = '';
|
||||
if (secondary || !changeYear)
|
||||
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 += this._get(inst, 'yearSuffix');
|
||||
if (showMonthAfterYear)
|
||||
html += (secondary || !(changeMonth && changeYear) ? ' ' : '') + monthHtml;
|
||||
|
Loading…
Reference in New Issue
Block a user