@@ -114,6 +114,9 @@ function Datepicker() {
114
114
$ . extend ( Datepicker . prototype , {
115
115
/* Class name added to elements to indicate already configured with a date picker. */
116
116
markerClassName : 'hasDatepicker' ,
117
+
118
+ //Keep track of the maximum number of rows displayed (see #7043)
119
+ maxRows : 4 ,
117
120
118
121
/* Debug logging (if enabled). */
119
122
log : function ( ) {
@@ -682,6 +685,7 @@ $.extend(Datepicker.prototype, {
682
685
/* Generate the date picker content. */
683
686
_updateDatepicker : function ( inst ) {
684
687
var self = this ;
688
+ self . maxRows = 4 ; //Reset the max number of rows being displayed (see #7043)
685
689
var borders = $ . datepicker . _getBorders ( inst . dpDiv ) ;
686
690
instActive = inst ; // for delegate hover events
687
691
inst . dpDiv . empty ( ) . append ( this . _generateHTML ( inst ) ) ;
@@ -1505,7 +1509,9 @@ $.extend(Datepicker.prototype, {
1505
1509
if ( drawYear == inst . selectedYear && drawMonth == inst . selectedMonth )
1506
1510
inst . selectedDay = Math . min ( inst . selectedDay , daysInMonth ) ;
1507
1511
var leadDays = ( this . _getFirstDayOfMonth ( drawYear , drawMonth ) - firstDay + 7 ) % 7 ;
1508
- var numRows = ( isMultiMonth ? 6 : Math . ceil ( ( leadDays + daysInMonth ) / 7 ) ) ; // calculate the number of rows to generate
1512
+ var curRows = Math . ceil ( ( leadDays + daysInMonth ) / 7 ) ; // calculate the number of rows to generate
1513
+ var numRows = ( isMultiMonth ? this . maxRows > curRows ? this . maxRows : curRows : curRows ) ; //If multiple months, use the higher number of rows (see #7043)
1514
+ this . maxRows = numRows ;
1509
1515
var printDate = this . _daylightSavingAdjust ( new Date ( drawYear , drawMonth , 1 - leadDays ) ) ;
1510
1516
for ( var dRow = 0 ; dRow < numRows ; dRow ++ ) { // create date picker rows
1511
1517
calender += '<tr>' ;
0 commit comments