fix: empty date error

This commit is contained in:
DIYgod
2023-05-03 23:02:49 +01:00
parent 70f494766b
commit d9fb3a8917
+1 -1
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()