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.
This commit is contained in:
parent
255a8dbba5
commit
98c53d8432
2
ui/jquery.ui.datepicker.js
vendored
2
ui/jquery.ui.datepicker.js
vendored
@ -1579,6 +1579,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>';
|
||||||
@ -1615,6 +1616,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