From 35c900aa7079c5f2afbdd64a9722fa5f40e6acc1 Mon Sep 17 00:00:00 2001 From: Xing Zhou Date: Tue, 18 Apr 2017 16:07:46 +0800 Subject: [PATCH] Fixed a tiny issue for ShortHumanDuration printer. Fixed a tiny issue for ShortHumanDuration printer to avoid "0y" message. --- pkg/printers/common.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/printers/common.go b/pkg/printers/common.go index cacd8de78c3..382ff5639ea 100644 --- a/pkg/printers/common.go +++ b/pkg/printers/common.go @@ -34,7 +34,7 @@ func ShortHumanDuration(d time.Duration) string { return fmt.Sprintf("%dm", minutes) } else if hours := int(d.Hours()); hours < 24 { return fmt.Sprintf("%dh", hours) - } else if hours < 24*364 { + } else if hours < 24*365 { return fmt.Sprintf("%dd", hours/24) } return fmt.Sprintf("%dy", int(d.Hours()/24/365))