mirror of
https://github.com/hibiken/asynqmon.git
synced 2025-01-18 18:55:54 +08:00
(ui): Fix timeAgo helper to return dash when zero time is passed
This commit is contained in:
parent
1601a0861a
commit
14effdde06
@ -64,7 +64,11 @@ export function durationBefore(timestamp: string): string {
|
||||
}
|
||||
}
|
||||
|
||||
const zeroTimestamp = "0001-01-01T00:00:00Z";
|
||||
export function timeAgo(timestamp: string): string {
|
||||
if (timestamp === zeroTimestamp) {
|
||||
return "-";
|
||||
}
|
||||
try {
|
||||
return timeAgoUnix(Date.parse(timestamp) / 1000);
|
||||
} catch (error) {
|
||||
|
Loading…
Reference in New Issue
Block a user