@@ -115,6 +115,9 @@ function Datepicker() {
115
115
$ . extend ( Datepicker . prototype , {
116
116
/* Class name added to elements to indicate already configured with a date picker. */
117
117
markerClassName : 'hasDatepicker' ,
118
+
119
+ //Keep track of the maximum number of rows displayed (see #7043)
120
+ maxRows : 4 ,
118
121
119
122
/* Debug logging (if enabled). */
120
123
log : function ( ) {
@@ -691,6 +694,7 @@ $.extend(Datepicker.prototype, {
691
694
/* Generate the date picker content. */
692
695
_updateDatepicker : function ( inst ) {
693
696
var self = this ;
697
+ self . maxRows = 4 ; //Reset the max number of rows being displayed (see #7043)
694
698
var borders = $ . datepicker . _getBorders ( inst . dpDiv ) ;
695
699
instActive = inst ; // for delegate hover events
696
700
inst . dpDiv . empty ( ) . append ( this . _generateHTML ( inst ) ) ;
@@ -1480,6 +1484,7 @@ $.extend(Datepicker.prototype, {
1480
1484
var html = '' ;
1481
1485
for ( var row = 0 ; row < numMonths [ 0 ] ; row ++ ) {
1482
1486
var group = '' ;
1487
+ this . maxRows = 4 ;
1483
1488
for ( var col = 0 ; col < numMonths [ 1 ] ; col ++ ) {
1484
1489
var selectedDate = this . _daylightSavingAdjust ( new Date ( drawYear , drawMonth , inst . selectedDay ) ) ;
1485
1490
var cornerClass = ' ui-corner-all' ;
@@ -1514,7 +1519,9 @@ $.extend(Datepicker.prototype, {
1514
1519
if ( drawYear == inst . selectedYear && drawMonth == inst . selectedMonth )
1515
1520
inst . selectedDay = Math . min ( inst . selectedDay , daysInMonth ) ;
1516
1521
var leadDays = ( this . _getFirstDayOfMonth ( drawYear , drawMonth ) - firstDay + 7 ) % 7 ;
1517
- var numRows = ( isMultiMonth ? 6 : Math . ceil ( ( leadDays + daysInMonth ) / 7 ) ) ; // calculate the number of rows to generate
1522
+ var curRows = Math . ceil ( ( leadDays + daysInMonth ) / 7 ) ; // calculate the number of rows to generate
1523
+ var numRows = ( isMultiMonth ? this . maxRows > curRows ? this . maxRows : curRows : curRows ) ; //If multiple months, use the higher number of rows (see #7043)
1524
+ this . maxRows = numRows ;
1518
1525
var printDate = this . _daylightSavingAdjust ( new Date ( drawYear , drawMonth , 1 - leadDays ) ) ;
1519
1526
for ( var dRow = 0 ; dRow < numRows ; dRow ++ ) { // create date picker rows
1520
1527
calender += '<tr>' ;
0 commit comments