fix: handle nullable expiry values from a db
This commit is contained in:
parent
dd479d4117
commit
d165264876
3 changed files with 8 additions and 2 deletions
|
|
@ -29,6 +29,7 @@ export default function Menu({ machine, routes, magic, users }: MenuProps) {
|
|||
|
||||
const expired = machine.expiry === '0001-01-01 00:00:00'
|
||||
|| machine.expiry === '0001-01-01T00:00:00Z'
|
||||
|| machine.expiry === null
|
||||
? false
|
||||
: new Date(machine.expiry).getTime() < Date.now()
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue