Skip to content

Commit

Permalink
Datepicker: Fixed #7043 - Using multiple months always renders 6 rows…
Browse files Browse the repository at this point in the history
… of dates even if only 5 are needed.
  • Loading branch information
kzys committed May 6, 2011
1 parent 476777f commit ac459ff
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion ui/jquery.ui.datepicker.js
Original file line number Diff line number Diff line change
Expand Up @@ -1489,7 +1489,7 @@ $.extend(Datepicker.prototype, {
if (drawYear == inst.selectedYear && drawMonth == inst.selectedMonth)
inst.selectedDay = Math.min(inst.selectedDay, daysInMonth);
var leadDays = (this._getFirstDayOfMonth(drawYear, drawMonth) - firstDay + 7) % 7;
var numRows = (isMultiMonth ? 6 : Math.ceil((leadDays + daysInMonth) / 7)); // calculate the number of rows to generate
var numRows = Math.ceil((leadDays + daysInMonth) / 7); // calculate the number of rows to generate
var printDate = this._daylightSavingAdjust(new Date(drawYear, drawMonth, 1 - leadDays));
for (var dRow = 0; dRow < numRows; dRow++) { // create date picker rows
calender += '<tr>';
Expand Down

0 comments on commit ac459ff

Please sign in to comment.