add missing case in entry and fix unit formatting; ref #13

This commit is contained in:
Derek Stevens 2021-12-18 21:41:20 -07:00
parent ba824325bc
commit dcd613622e
No known key found for this signature in database
GPG key ID: 3B7FBC22144E6398
2 changed files with 6 additions and 6 deletions

View file

@ -107,13 +107,13 @@ func (entry *Entry) GetOutputForTrack(isRunning bool, wasRunning bool) (string)
now := time.Now() now := time.Now()
trackDiffNow := now.Sub(entry.Begin) trackDiffNow := now.Sub(entry.Begin)
trackDiffNowOut := time.Time{}.Add(trackDiffNow) durationString := fmtDuration(trackDiffNow)
if isRunning == true && wasRunning == false { if isRunning == true && wasRunning == false {
outputPrefix = "began tracking" outputPrefix = "began tracking"
} else if isRunning == true && wasRunning == true { } else if isRunning == true && wasRunning == true {
outputPrefix = "tracking" outputPrefix = "tracking"
outputSuffix = fmt.Sprintf(" for %sh", color.FgLightWhite.Render(trackDiffNowOut.Format("15:04"))) outputSuffix = fmt.Sprintf(" for %sh", color.FgLightWhite.Render(durationString))
} else if isRunning == false && wasRunning == false { } else if isRunning == false && wasRunning == false {
outputPrefix = "tracked" outputPrefix = "tracked"
} }