From 18a902799e50b8c0db94653bdae436573e4308a9 Mon Sep 17 00:00:00 2001 From: maradini77 <140460067+maradini77@users.noreply.github.com> Date: Sat, 1 Nov 2025 06:17:45 +0100 Subject: [PATCH] common: fix duration comparison in PrettyAge (#33064) This pull request updates `PrettyAge.String` so that the age formatter now treats exact unit boundaries (like a full day or week) as that unit instead of spilling into smaller components, keeping duration output aligned with human expectations. --- common/format.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common/format.go b/common/format.go index 7af41f52d5..31e08831f5 100644 --- a/common/format.go +++ b/common/format.go @@ -69,7 +69,7 @@ func (t PrettyAge) String() string { result, prec := "", 0 for _, unit := range ageUnits { - if diff > unit.Size { + if diff >= unit.Size { result = fmt.Sprintf("%s%d%s", result, diff/unit.Size, unit.Symbol) diff %= unit.Size