nikolassv / bartib

A simple timetracker for the command line. It saves a log of all tracked activities as a plaintext file and allows you to create flexible reports.
GNU General Public License v3.0
670 stars 35 forks source link

amount of seconds will not be recorded. #19

Closed ws051682 closed 1 year ago

ws051682 commented 1 year ago

I suppose that Bartib will not calculate the seconds.

however, it will record the tasks that took only a few seconds and show 0s in it's duration.

this is tricky. I will suggest either not to record such an activity or calculate also the seconds.

here's an example

PS C:\Users\me> date
Monday, March 20, 2023 1:08:52 PM
PS C:\Users\me> bartib start -d "task1" -p "project1"
Started activity: "task1" (project1) at 2023-03-20 13:09
PS C:\Users\me> date
Monday, March 20, 2023 1:09:11 PM
PS C:\Users\me> bartib stop
Stopped activity: "task1" (project1) started at 2023-03-20 13:09 (16s)
PS C:\Users\me> date
Monday, March 20, 2023 1:09:21 PM
PS C:\Users\me> bartib list
Started Stopped Description Project  Duration

2023-03-20
13:09   13:09   task1       project1 0s      
nikolassv commented 1 year ago

Thank you for raising this issue! You are right that the amount of seconds is not recorded in the bartib file but shown in lists and reports. I am not quite sure what would be the best solutions. Right now I see two possibilities:

  1. We display the duration of activities shorter than one minute as "0m" (and not as "0s" which may not be true).
  2. We record the seconds of start and end times in the bartib file which would allow us to calculate the exact duration.

I tend to prefer the first solutions. First it is easier to implement and secondly it would keep the timestamps in the bartib file simpler.

I would refrain from not recording or listing activities without a duration. Even if these activities did not take any time they may be of value to same user. They may for example be placeholdes which the user plan to edit later.

What do you think?

ws051682 commented 1 year ago

thanks a lot for the quick response.

i also believe the 1st solution would be the best since it make nearly no sense to track the duration in seconds, and indeed a placeholder is important.

However i will suggest to show "<1m" instead of 0s.

this will be more precise.