Skip to content

Commit

Permalink
Date Picker fixed bug with rendering the grid of dates for a year and…
Browse files Browse the repository at this point in the history
… month (#1082)
  • Loading branch information
jongund authored and mcking65 committed Jul 14, 2019
1 parent 1bf0520 commit e8099ca
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions examples/dialog-modal/js/datepicker.js
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,9 @@ DatePicker.prototype.updateGrid = function () {
var daysInMonth = new Date(fd.getFullYear(), fd.getMonth() + 1, 0).getDate();
var dayOfWeek = firstDayOfMonth.getDay();

var d = new Date(firstDayOfMonth - dayOfWeek);
firstDayOfMonth.setDate(firstDayOfMonth.getDate() - dayOfWeek);

var d = new Date(firstDayOfMonth);

for (i = 0; i < this.days.length; i++) {
flag = d.getMonth() != fd.getMonth();
Expand All @@ -134,9 +136,12 @@ DatePicker.prototype.updateGrid = function () {
d.setDate(d.getDate() + 1);
}

if (dayOfWeek + daysInMonth < 35) {
if ((dayOfWeek + daysInMonth) < 36) {
this.hideLastRow();
}
else {
this.showLastRow();
}

};

Expand Down

0 comments on commit e8099ca

Please sign in to comment.