fix: use floor for duration minutes to prevent 60m overflow
This commit is contained in:
@@ -14,7 +14,7 @@ function duration(valueMs: number | undefined): string | undefined {
|
||||
const ms = Math.max(0, valueMs);
|
||||
const days = Math.floor(ms / 86_400_000);
|
||||
const hours = Math.floor((ms % 86_400_000) / 3_600_000);
|
||||
const minutes = Math.round((ms % 3_600_000) / 60_000);
|
||||
const minutes = Math.floor((ms % 3_600_000) / 60_000);
|
||||
if (days > 0) return `${days}d${hours}h`;
|
||||
if (hours > 0) return `${hours}h${minutes}m`;
|
||||
return `${minutes}m`;
|
||||
|
||||
Reference in New Issue
Block a user