From f5f07c88f6b37731aacf050e9d7d940b378f5570 Mon Sep 17 00:00:00 2001 From: Cagatay Civici Date: Wed, 17 Nov 2021 17:29:26 +0300 Subject: [PATCH] Consider min and max date when initializing view date --- src/components/calendar/Calendar.vue | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/src/components/calendar/Calendar.vue b/src/components/calendar/Calendar.vue index a9a964a8c..bdffa8587 100755 --- a/src/components/calendar/Calendar.vue +++ b/src/components/calendar/Calendar.vue @@ -2194,7 +2194,19 @@ export default { propValue = propValue[0]; } - return propValue || new Date(); + if (propValue) { + return propValue; + } + else { + let today = new Date(); + if (this.maxDate && this.maxDate < today) { + return this.maxDate; + } + if (this.minDate && this.minDate > today) { + return this.minDate; + } + return today; + } }, inputFieldValue() { return this.formatValue(this.modelValue);