docker images
friendly duration gets unfriendly after a while
fix #12852 Signed-off-by: Daniel Zhang <jmzwcn@gmail.com>
This commit is contained in:
parent
861cba008d
commit
7a9788fb68
2 changed files with 4 additions and 3 deletions
|
@ -26,6 +26,7 @@ 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("%f years", d.Hours()/24/365)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue