From b3ef5b0eea08593f9faa6b468d84c0fe8a3f5865 Mon Sep 17 00:00:00 2001 From: Yuriy Yevstihnyeyev Date: Thu, 31 May 2018 16:30:31 +0300 Subject: [PATCH] Updating checks for min and max --- src/vaadin-month-calendar.html | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/vaadin-month-calendar.html b/src/vaadin-month-calendar.html index 12a0a053..219ef146 100644 --- a/src/vaadin-month-calendar.html +++ b/src/vaadin-month-calendar.html @@ -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); }