diff --git a/units/duration.go b/units/duration.go index a31f780..44012aa 100644 --- a/units/duration.go +++ b/units/duration.go @@ -26,7 +26,6 @@ func HumanDuration(d time.Duration) string { return fmt.Sprintf("%d weeks", hours/24/7) } else if hours < 24*365*2 { return fmt.Sprintf("%d months", hours/24/30) - } else { - return fmt.Sprintf("%d years", hours/24/365) } + return fmt.Sprintf("%d years", int(d.Hours())/24/365) }