Skip to content

Commit 1c9fb58

Browse files
simonkleeBenGu3
authored andcommitted
tui: fix multi-day duration formatting (anomalyco#33651)
Report elapsed days and remaining hours instead of showing zero days and the total duration as hours. Close anomalyco#32957 Close anomalyco#32956
1 parent 3d72025 commit 1c9fb58

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

‎packages/tui/src/util/locale.ts‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,8 @@ export function duration(input: number) {
5353
const minutes = Math.floor((input % 3600000) / 60000)
5454
return `${hours}h ${minutes}m`
5555
}
56-
const hours = Math.floor(input / 3600000)
57-
const days = Math.floor((input % 3600000) / 86400000)
56+
const days = Math.floor(input / 86400000)
57+
const hours = Math.floor((input % 86400000) / 3600000)
5858
return `${days}d ${hours}h`
5959
}
6060

0 commit comments

Comments
 (0)