diff --git a/z/finish.go b/z/finish.go index 561a411..0d57c51 100644 --- a/z/finish.go +++ b/z/finish.go @@ -59,12 +59,15 @@ var finishCmd = &cobra.Command{ log.Fatal(err) } + trackDiff := runningEntry.Finish.Sub(runningEntry.Begin) + trackDiffOut := time.Time{}.Add(trackDiff) + if runningEntry.Task != "" && runningEntry.Project != "" { - fmt.Printf("□ finished tracking %s on %s\n", color.FgLightWhite.Render(runningEntry.Task), color.FgLightWhite.Render(runningEntry.Project)) + fmt.Printf("□ finished tracking %s on %s for %sh\n", color.FgLightWhite.Render(runningEntry.Task), color.FgLightWhite.Render(runningEntry.Project), trackDiffOut.Format("15:04")) } else if runningEntry.Task != "" && runningEntry.Project == "" { - fmt.Printf("□ finished tracking %s\n", color.FgLightWhite.Render(runningEntry.Task)) + fmt.Printf("□ finished tracking %s for %sh\n", color.FgLightWhite.Render(runningEntry.Task), trackDiffOut.Format("15:04")) } else if runningEntry.Task == "" && runningEntry.Project != "" { - fmt.Printf("□ finished tracking task on %s\n", color.FgLightWhite.Render(runningEntry.Project)) + fmt.Printf("□ finished tracking task on %s for %sh\n", color.FgLightWhite.Render(runningEntry.Project), trackDiffOut.Format("15:04")) } else { fmt.Printf("□ finished tracking task\n") }