mirror of
https://github.com/hibiken/asynqmon.git
synced 2025-08-23 22:28:43 +08:00
(ui): Fix timeAgo helper to return dash when zero time is passed
This commit is contained in:
@@ -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) {
|
||||
|
Reference in New Issue
Block a user