Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MAGETWO-61209: Issue #7379 Calendar widget (jQuery UI DatePicker) with numberOfMonths = 2 or more #16278

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
10 changes: 6 additions & 4 deletions lib/web/mage/calendar.js
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