Merge pull request #1101 from harshavardhana/time-fix

Show seconds and minutes only when hours and days are non zero
This commit is contained in:
Harshavardhana
2015-09-14 13:13:02 -07:00
+2 -2
View File
@@ -31,10 +31,10 @@ type humanizedTime struct {
// String() humanizes humanizedTime to human readable,
func (r humanizedTime) String() string {
if r.Minutes == 0 {
if r.Days == 0 && r.Hours == 0 && r.Minutes == 0 {
return fmt.Sprintf("%d seconds", r.Seconds)
}
if r.Hours == 0 {
if r.Days == 0 && r.Hours == 0 {
return fmt.Sprintf("%d minutes %d seconds", r.Minutes, r.Seconds)
}
if r.Days == 0 {