Skip to content

Commit de533cc

Browse files
author
Vasilii Burlacu
committed
MAGETWO-61209: Fixed issue with mage/calendar when setting numberOfMonths to show more than 1 month
(cherry picked from commit 54e1a71)
1 parent f38cc97 commit de533cc

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

lib/web/mage/calendar.js

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -236,12 +236,14 @@
236236
firstDay = parseInt(this._get(inst, 'firstDay'), 10);
237237
firstDay = isNaN(firstDay) ? 0 : firstDay;
238238

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

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

245+
calender = '';
246+
245247
if (isMultiMonth) {
246248
calender += '<div class="ui-datepicker-group';
247249

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

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

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

0 commit comments

Comments
 (0)