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 authored and tomivirkki committed Jun 12, 2018
1 parent 4088370 commit b3ef5b0
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 b3ef5b0

Please sign in to comment.