Skip to content

Commit 16de24b

Browse files
author
Chris Rohr
committed
Datepicker: removed the mozilla check when building the year select box. Fixed #7176 - Datepicker shows only single year in year dropdown if numberOfMonths > 1
1 parent 91c2f3e commit 16de24b

File tree

2 files changed

+25
-8
lines changed

2 files changed

+25
-8
lines changed
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8" />
5+
<title>Datepicker Visual Test : Default</title>
6+
<link rel="stylesheet" href="../visual.css" type="text/css" />
7+
<link rel="stylesheet" href="../../../themes/base/jquery.ui.all.css" type="text/css">
8+
<script type="text/javascript" src="../../../jquery-1.5.1.js"></script>
9+
<script type="text/javascript" src="../../../ui/jquery.ui.core.js"></script>
10+
<script type="text/javascript" src="../../../ui/jquery.ui.widget.js"></script>
11+
<script type="text/javascript" src="../../../ui/jquery.ui.datepicker.js"></script>
12+
<script type="text/javascript">
13+
$(function() {
14+
$('#datepicker').datepicker({numberOfMonths: 3, changeMonth: true, changeYear: true, yearRange: '2007:2015'});
15+
});
16+
</script>
17+
</head>
18+
<body>
19+
20+
<div id="datepicker"></div>
21+
22+
</body>
23+
</html>

ui/jquery.ui.datepicker.js

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1606,14 +1606,8 @@ $.extend(Datepicker.prototype, {
16061606
'>' + year + '</option>';
16071607
}
16081608
inst.yearshtml += '</select>';
1609-
//when showing there is no need for later update
1610-
if( ! $.browser.mozilla ){
1611-
html += inst.yearshtml;
1612-
inst.yearshtml = null;
1613-
} else {
1614-
// will be replaced later with inst.yearshtml
1615-
html += '<select class="ui-datepicker-year"><option value="' + drawYear + '" selected="selected">' + drawYear + '</option></select>';
1616-
}
1609+
html += inst.yearshtml;
1610+
inst.yearshtml = null;
16171611
}
16181612
html += this._get(inst, 'yearSuffix');
16191613
if (showMonthAfterYear)

0 commit comments

Comments
 (0)