From 167b6b2ab017ffde3cad474eca946e39128f0d45 Mon Sep 17 00:00:00 2001 From: tugcekucukoglu Date: Wed, 11 Sep 2024 10:48:04 +0300 Subject: [PATCH] Fixed #6342 --- packages/primevue/src/datepicker/DatePicker.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/primevue/src/datepicker/DatePicker.vue b/packages/primevue/src/datepicker/DatePicker.vue index 740bcb5a7..9c04e5ae4 100755 --- a/packages/primevue/src/datepicker/DatePicker.vue +++ b/packages/primevue/src/datepicker/DatePicker.vue @@ -728,7 +728,7 @@ export default { return this.modelValue.some((currentValue) => currentValue.getMonth() === month && currentValue.getFullYear() === this.currentYear); } else if (this.isRangeSelection()) { if (!this.modelValue[1]) { - return this.modelValue[0].getFullYear() === this.currentYear && this.modelValue[0].getMonth() === month; + return this.modelValue[0]?.getFullYear() === this.currentYear && this.modelValue[0]?.getMonth() === month; } else { const currentDate = new Date(this.currentYear, month, 1); const startDate = new Date(this.modelValue[0].getFullYear(), this.modelValue[0].getMonth(), 1);