Skip to content

Commit b9fc7e2

Browse files
author
Stanislav Idolov
authored
ENGCOM-2108: MAGETWO-61209: Backport - Fixed issue #7379 with mage/calendar when setting `numberOfM… #16280
2 parents af2c7a6 + ebccd5c commit b9fc7e2

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
@@ -238,12 +238,14 @@
238238
firstDay = parseInt(this._get(inst, 'firstDay'), 10);
239239
firstDay = isNaN(firstDay) ? 0 : firstDay;
240240

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

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

247+
calender = '';
248+
247249
if (isMultiMonth) {
248250
calender += '<div class="ui-datepicker-group';
249251

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

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

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

0 commit comments

Comments
 (0)