fix: properly parse dates or null
Resolves https://kolaente.dev/vikunja/frontend/issues/2214
This commit is contained in:
parent
31480eae72
commit
e82a83c8cf
1 changed files with 3 additions and 2 deletions
|
@ -6,8 +6,9 @@ export function parseDateOrNull(date) {
|
||||||
return date
|
return date
|
||||||
}
|
}
|
||||||
|
|
||||||
if (date && !date.startsWith('0001')) {
|
if ((typeof date === 'string' || date instanceof String) && !date.startsWith('0001')) {
|
||||||
return new Date(date)
|
return new Date(date)
|
||||||
}
|
}
|
||||||
|
|
||||||
return null
|
return null
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue