Update timeAgo helper to show duration in days if it's more than 24h

This commit is contained in:
Ken Hibino 2021-01-16 16:17:17 -08:00
parent 29b6ad8c91
commit ae6f1f7064

View File

@ -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` : "") +