mirror of
https://github.com/hibiken/asynqmon.git
synced 2025-01-19 03:05:53 +08:00
Update timeAgo helper to show duration in days if it's more than 24h
This commit is contained in:
parent
29b6ad8c91
commit
ae6f1f7064
@ -27,6 +27,10 @@ function durationBetween(start: number, end: number): Duration {
|
||||
}
|
||||
|
||||
function stringifyDuration(d: Duration): string {
|
||||
if (d.hour > 24) {
|
||||
const n = Math.floor(d.hour / 24);
|
||||
return n + (n === 1 ? " day" : " days");
|
||||
}
|
||||
return (
|
||||
(d.hour !== 0 ? `${d.hour}h` : "") +
|
||||
(d.minute !== 0 ? `${d.minute}m` : "") +
|
||||
|
Loading…
Reference in New Issue
Block a user