common: fix duration comparison in PrettyAge #33064 (#1776)

This commit is contained in:
wit liu 2025-11-15 19:23:17 +08:00 committed by GitHub
parent 0b2fe7d7b5
commit 999b775d8e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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