mirror of
https://gitee.com/zhangsken/opencode.git
synced 2026-10-16 10:30:01 +08:00
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:
@@ -53,8 +53,8 @@ export function duration(input: number) {
|
||||
const minutes = Math.floor((input % 3600000) / 60000)
|
||||
return `${hours}h ${minutes}m`
|
||||
}
|
||||
const hours = Math.floor(input / 3600000)
|
||||
const days = Math.floor((input % 3600000) / 86400000)
|
||||
const days = Math.floor(input / 86400000)
|
||||
const hours = Math.floor((input % 86400000) / 3600000)
|
||||
return `${days}d ${hours}h`
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user