Skip to content

Commit

Permalink
Updating checks for min and max
Browse files Browse the repository at this point in the history
  • Loading branch information
yuriy-fix committed Jun 1, 2018
1 parent 5290a97 commit 5addc94
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/vaadin-month-calendar.html
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,13 @@
lastDate.setMonth(month.getMonth() + 1);
lastDate.setDate(-1);

if ((minDate && maxDate)
&& minDate.getMonth() === maxDate.getMonth()
&& minDate.getMonth() === month.getMonth()
&& maxDate.getDate() - minDate.getDate() >= 0) {
return false;
}

return !this._dateAllowed(firstDate, minDate, maxDate)
&& !this._dateAllowed(lastDate, minDate, maxDate);
}
Expand Down

0 comments on commit 5addc94

Please sign in to comment.