jazzband / Watson

:watch: A wonderful CLI to track your time!
http://tailordev.github.io/Watson/
MIT License
2.46k stars 240 forks source link

Add addbreak command, to insert a break in a frame #426

Closed guglielmo closed 3 years ago

guglielmo commented 3 years ago

Many times you forget to stop the tracking for a lunch break, or a call, or another interrupting task.

I find it useful to have the possibility of inserting a break (or interval) into a frame, effectively splitting the frame into 2 distinct ones.

A break, or interval, is defined only by a start datetime and an end datetime.

--------[                A               ]---------->
--------[     A1    ]    BR    [   A2    ]---------->

A break BR is inserted in frame A, dividing it into frames A1 and A2.

The following are true:

A simpler way to look at this could be to insert a break just by changing the starting datetime of A, and generating a new frame A1 that is a copy of A in the past, up to the beginning of the break.

--------[                A               ]---------->
--------[     A1    ]    BR    [   A     ]---------->

Then A will continnue to be the current frame, and A1 will be the frame before the break.

Please, consider I am a newbie on Watson, maybe there's already a way to approach this issue.

jmaupetit commented 3 years ago

What I usually do in this case is using the --at flag of the Watson start / stop / restart commands:

$ watson stop --at 12:34
$ watson restart --at 14:02

Or a restart / start (with stop_on_start / stop_on_restart settings activated) and edit the lunchtime break frame (A1) to change the stop date/time.

Do you think it will suit your needs?

guglielmo commented 3 years ago

I think this is fit, it's just two commands.