From 6281e35a189caf3a8642e9a3b312d1da32a64456 Mon Sep 17 00:00:00 2001 From: Simon Klee Date: Wed, 24 Jun 2026 14:05:06 +0200 Subject: [PATCH] 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 --- packages/tui/src/util/locale.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/tui/src/util/locale.ts b/packages/tui/src/util/locale.ts index ec900b441..ddcb973e7 100644 --- a/packages/tui/src/util/locale.ts +++ b/packages/tui/src/util/locale.ts @@ -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` }