Skip to content

Commit

Permalink
MAGETWO-61209: Fixed issue with mage/calendar when setting `numberOfM…
Browse files Browse the repository at this point in the history
…onths` to show more than 1 month
  • Loading branch information
Vasilii Burlacu committed Jun 20, 2018
1 parent 9ff7742 commit 54e1a71
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions lib/web/mage/calendar.js
Original file line number Diff line number Diff line change
Expand Up @@ -236,12 +236,14 @@
firstDay = parseInt(this._get(inst, 'firstDay'), 10);
firstDay = isNaN(firstDay) ? 0 : firstDay;

for (row; row < numMonths[0]; row++) {
for (row = 0; row < numMonths[0]; row++) {
this.maxRows = 4;

for (col; col < numMonths[1]; col++) {
for (col = 0; col < numMonths[1]; col++) {
selectedDate = this._daylightSavingAdjust(new Date(drawYear, drawMonth, inst.selectedDay));

calender = '';

if (isMultiMonth) {
calender += '<div class="ui-datepicker-group';

Expand Down Expand Up @@ -271,7 +273,7 @@
thead = showWeek ?
'<th class="ui-datepicker-week-col">' + this._get(inst, 'weekHeader') + '</th>' : '';

for (dow; dow < 7; dow++) { // days of the week
for (dow = 0; dow < 7; dow++) { // days of the week
day = (dow + firstDay) % 7;
thead += '<th' + ((dow + firstDay + 6) % 7 >= 5 ?
' class="ui-datepicker-week-end"' : '') + '>' +
Expand All @@ -289,7 +291,7 @@
this.maxRows = numRows;
printDate = this._daylightSavingAdjust(new Date(drawYear, drawMonth, 1 - leadDays));

for (dRow; dRow < numRows; dRow++) { // create date picker rows
for (dRow = 0; dRow < numRows; dRow++) { // create date picker rows
calender += '<tr>';
tbody = !showWeek ? '' : '<td class="ui-datepicker-week-col">' +
this._get(inst, 'calculateWeek')(printDate) + '</td>';
Expand Down

0 comments on commit 54e1a71

Please sign in to comment.