fix: empty date error

This commit is contained in:
DIYgod 2023-05-03 23:02:49 +01:00
parent 70f494766b
commit d9fb3a8917
No known key found for this signature in database
1 changed files with 1 additions and 1 deletions

View File

@ -29,7 +29,7 @@ export function useDate() {
return dayjs(date).tz(timezone).format(format)
},
formatToISO: (date: string | Date) => {
return dayjs(date).toISOString()
return dayjs(date || undefined).toISOString()
},
inLocalTimezone: (date: string | Date) => {
return dayjs(date).tz().toDate()