Skip to content

Commit

Permalink
fix(date): check if date is null | undefined | falsy in isValid
Browse files Browse the repository at this point in the history
  • Loading branch information
johnleider committed Sep 8, 2023
1 parent 6bd0f2c commit a1a1ca7
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions packages/vuetify/src/labs/date/adapters/vuetify.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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())
Expand Down

0 comments on commit a1a1ca7

Please sign in to comment.