mirror of
https://github.com/tale/headplane.git
synced 2026-07-26 15:58:14 +00:00
fix: handle 0001-01-01 00:00:00 as the no-expiry timestamp
This commit is contained in:
@@ -48,7 +48,10 @@ export default function Page() {
|
||||
const { machine, magic, routes } = useLoaderData<typeof loader>()
|
||||
useLiveData({ interval: 1000 })
|
||||
|
||||
const expired = new Date(machine.expiry).getTime() < Date.now()
|
||||
const expired = machine.expiry === '0001-01-01 00:00:00'
|
||||
? false
|
||||
: new Date(machine.expiry).getTime() < Date.now()
|
||||
|
||||
const tags = [
|
||||
...machine.forcedTags,
|
||||
...machine.validTags,
|
||||
|
||||
@@ -16,7 +16,9 @@ interface Props {
|
||||
}
|
||||
|
||||
export default function MachineRow({ machine, routes, magic }: Props) {
|
||||
const expired = new Date(machine.expiry).getTime() < Date.now()
|
||||
const expired = machine.expiry === '0001-01-01 00:00:00'
|
||||
? false
|
||||
: new Date(machine.expiry).getTime() < Date.now()
|
||||
|
||||
const tags = [
|
||||
...machine.forcedTags,
|
||||
|
||||
@@ -22,7 +22,9 @@ export default function Menu({ machine, routes, magic }: MenuProps) {
|
||||
const removeState = useState(false)
|
||||
const routesState = useState(false)
|
||||
|
||||
const expired = new Date(machine.expiry).getTime() < Date.now()
|
||||
const expired = machine.expiry === '0001-01-01 00:00:00'
|
||||
? false
|
||||
: new Date(machine.expiry).getTime() < Date.now()
|
||||
|
||||
return (
|
||||
<>
|
||||
|
||||
Reference in New Issue
Block a user