tui: fix multi-day duration formatting (#33651)

Report elapsed days and remaining hours instead of showing zero days and
the total duration as hours.

Close #32957
Close #32956
This commit is contained in:
Simon Klee
2026-06-24 14:05:06 +02:00
committed by GitHub
parent bd149f0daa
commit 6281e35a18
+2 -2
View File
@@ -53,8 +53,8 @@ export function duration(input: number) {
const minutes = Math.floor((input % 3600000) / 60000) const minutes = Math.floor((input % 3600000) / 60000)
return `${hours}h ${minutes}m` return `${hours}h ${minutes}m`
} }
const hours = Math.floor(input / 3600000) const days = Math.floor(input / 86400000)
const days = Math.floor((input % 3600000) / 86400000) const hours = Math.floor((input % 86400000) / 3600000)
return `${days}d ${hours}h` return `${days}d ${hours}h`
} }