ADD - normalize database timestamps

This commit is contained in:
Leon.Schmidt
2026-08-06 18:31:00 +02:00
parent d8e5a18773
commit bd4aaede5d
+10
View File
@@ -0,0 +1,10 @@
export type DatabaseDateValue = string | number
export function parseDatabaseDate(value: DatabaseDateValue): Date {
if (typeof value === 'number') {
const timestamp = Math.abs(value) < 1_000_000_000_000 ? value * 1000 : value
return new Date(timestamp)
}
return new Date(value.replace(' ', 'T'))
}