@@ -114,6 +114,9 @@ function Datepicker() {
114114$ . extend ( Datepicker . prototype , {
115115 /* Class name added to elements to indicate already configured with a date picker. */
116116 markerClassName : 'hasDatepicker' ,
117+
118+ //Keep track of the maximum number of rows displayed (see #7043)
119+ maxRows : 4 ,
117120
118121 /* Debug logging (if enabled). */
119122 log : function ( ) {
@@ -680,6 +683,7 @@ $.extend(Datepicker.prototype, {
680683 /* Generate the date picker content. */
681684 _updateDatepicker : function ( inst ) {
682685 var self = this ;
686+ self . maxRows = 4 ; //Reset the max number of rows being displayed (see #7043)
683687 var borders = $ . datepicker . _getBorders ( inst . dpDiv ) ;
684688 instActive = inst ; // for delegate hover events
685689 inst . dpDiv . empty ( ) . append ( this . _generateHTML ( inst ) ) ;
@@ -1501,7 +1505,9 @@ $.extend(Datepicker.prototype, {
15011505 if ( drawYear == inst . selectedYear && drawMonth == inst . selectedMonth )
15021506 inst . selectedDay = Math . min ( inst . selectedDay , daysInMonth ) ;
15031507 var leadDays = ( this . _getFirstDayOfMonth ( drawYear , drawMonth ) - firstDay + 7 ) % 7 ;
1504- var numRows = ( isMultiMonth ? 6 : Math . ceil ( ( leadDays + daysInMonth ) / 7 ) ) ; // calculate the number of rows to generate
1508+ var curRows = Math . ceil ( ( leadDays + daysInMonth ) / 7 ) ; // calculate the number of rows to generate
1509+ var numRows = ( isMultiMonth ? this . maxRows > curRows ? this . maxRows : curRows : curRows ) ; //If multiple months, use the higher number of rows (see #7043)
1510+ this . maxRows = numRows ;
15051511 var printDate = this . _daylightSavingAdjust ( new Date ( drawYear , drawMonth , 1 - leadDays ) ) ;
15061512 for ( var dRow = 0 ; dRow < numRows ; dRow ++ ) { // create date picker rows
15071513 calender += '<tr>' ;
0 commit comments