From a1a1ca7379ba0e03d5282f0955ead1981357a950 Mon Sep 17 00:00:00 2001 From: John Leider Date: Thu, 7 Sep 2023 15:04:38 -0500 Subject: [PATCH] fix(date): check if date is null | undefined | falsy in isValid --- packages/vuetify/src/labs/date/adapters/vuetify.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/packages/vuetify/src/labs/date/adapters/vuetify.ts b/packages/vuetify/src/labs/date/adapters/vuetify.ts index 5f0c520a9bf..7866d1dc88f 100644 --- a/packages/vuetify/src/labs/date/adapters/vuetify.ts +++ b/packages/vuetify/src/labs/date/adapters/vuetify.ts @@ -307,6 +307,8 @@ function isWithinRange (date: Date, range: [Date, Date]) { } function isValid (date: any) { + if (!date || date == null) return false + const d = new Date(date) return d instanceof Date && !isNaN(d.getTime())