@@ -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 ( ) {
@@ -680,6 +683,7 @@ $.extend(Datepicker.prototype, {
680
683
/* Generate the date picker content. */
681
684
_updateDatepicker : function ( inst ) {
682
685
var self = this ;
686
+ self . maxRows = 4 ; //Reset the max number of rows being displayed (see #7043)
683
687
var borders = $ . datepicker . _getBorders ( inst . dpDiv ) ;
684
688
instActive = inst ; // for delegate hover events
685
689
inst . dpDiv . empty ( ) . append ( this . _generateHTML ( inst ) ) ;
@@ -1501,7 +1505,9 @@ $.extend(Datepicker.prototype, {
1501
1505
if ( drawYear == inst . selectedYear && drawMonth == inst . selectedMonth )
1502
1506
inst . selectedDay = Math . min ( inst . selectedDay , daysInMonth ) ;
1503
1507
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 ;
1505
1511
var printDate = this . _daylightSavingAdjust ( new Date ( drawYear , drawMonth , 1 - leadDays ) ) ;
1506
1512
for ( var dRow = 0 ; dRow < numRows ; dRow ++ ) { // create date picker rows
1507
1513
calender += '<tr>' ;
0 commit comments