feat: add date range filter to task filters

This commit is contained in:
kolaente 2022-01-09 17:27:28 +01:00
parent 3a12be505d
commit 7aa2cfc8d4
Signed by untrusted user who does not match committer: konrad
GPG key ID: F40E70337AB24C9B
6 changed files with 58 additions and 91 deletions

View file

@ -0,0 +1,12 @@
export function parseDateOrString(rawValue: string, fallback: any) {
if (typeof rawValue === 'undefined') {
return fallback
}
const d = new Date(rawValue)
// @ts-ignore if rawValue is an invalid date, isNan will return false.
return !isNaN(d)
? d
: rawValue
}