From b5de7e69944206be79b31d91e119f5221dea9d22 Mon Sep 17 00:00:00 2001 From: Ken Hibino Date: Fri, 28 May 2021 15:49:11 -0700 Subject: [PATCH] Update timeAgo helper to handle zero unix time --- ui/src/utils.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ui/src/utils.ts b/ui/src/utils.ts index 3f9e0eb..b668a0f 100644 --- a/ui/src/utils.ts +++ b/ui/src/utils.ts @@ -68,7 +68,10 @@ export function timeAgo(timestamp: string): string { } } -export function timeAgoUnix(unixtime: number) { +export function timeAgoUnix(unixtime: number): string { + if (unixtime === 0) { + return "" + } const duration = durationBetween(Date.now(), unixtime * 1000); return stringifyDuration(duration) + " ago"; }