@@ -115,6 +115,9 @@ function Datepicker() {
115115$ . extend ( Datepicker . prototype , {
116116 /* Class name added to elements to indicate already configured with a date picker. */
117117 markerClassName : 'hasDatepicker' ,
118+
119+ //Keep track of the maximum number of rows displayed (see #7043)
120+ maxRows : 4 ,
118121
119122 /* Debug logging (if enabled). */
120123 log : function ( ) {
@@ -691,6 +694,7 @@ $.extend(Datepicker.prototype, {
691694 /* Generate the date picker content. */
692695 _updateDatepicker : function ( inst ) {
693696 var self = this ;
697+ self . maxRows = 4 ; //Reset the max number of rows being displayed (see #7043)
694698 var borders = $ . datepicker . _getBorders ( inst . dpDiv ) ;
695699 instActive = inst ; // for delegate hover events
696700 inst . dpDiv . empty ( ) . append ( this . _generateHTML ( inst ) ) ;
@@ -1480,6 +1484,7 @@ $.extend(Datepicker.prototype, {
14801484 var html = '' ;
14811485 for ( var row = 0 ; row < numMonths [ 0 ] ; row ++ ) {
14821486 var group = '' ;
1487+ this . maxRows = 4 ;
14831488 for ( var col = 0 ; col < numMonths [ 1 ] ; col ++ ) {
14841489 var selectedDate = this . _daylightSavingAdjust ( new Date ( drawYear , drawMonth , inst . selectedDay ) ) ;
14851490 var cornerClass = ' ui-corner-all' ;
@@ -1514,7 +1519,9 @@ $.extend(Datepicker.prototype, {
15141519 if ( drawYear == inst . selectedYear && drawMonth == inst . selectedMonth )
15151520 inst . selectedDay = Math . min ( inst . selectedDay , daysInMonth ) ;
15161521 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 ;
15181525 var printDate = this . _daylightSavingAdjust ( new Date ( drawYear , drawMonth , 1 - leadDays ) ) ;
15191526 for ( var dRow = 0 ; dRow < numRows ; dRow ++ ) { // create date picker rows
15201527 calender += '<tr>' ;
0 commit comments