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
636 stars 34 forks source link

Report tasks over midnight #29

Open michelepagot opened 8 months ago

michelepagot commented 8 months ago

Someone could say that midnight is usually a good moment not to be at the keyboard and sleep...

Apart from this

2023-10-12 18:45 - 2023-10-12 18:50 | difficult_prj | Doing something long
2023-10-12 23:31 - 2023-10-13 00:09 | difficult_prj | Doing something long
2023-10-13 00:10 - 2023-10-13 01:13 | difficult_prj | Doing something long

At 00:09 I run bartib report --today and the response was not ok. (so I stopped and started it to attempt to understand what was going on)

I'm not sure what to ask here, is there a bug when we cross date? maybe we can add --last24 near of --today ?

nikolassv commented 8 months ago

Thank you for raising the issue! You are right: reports for activities that span multiple days could use some refinement. Currently, each activity is reported for the date it began.

One potential solution could be to provide an option for reporting activities over a more specific time period, such as the last 24 or 12 hours. However, the fundamental issue remains the same: how should we handle activities that are active during the reporting period but begin before or extend beyond it?

Perhaps the optimal solution is to include all activities in a report that are active during the reporting period, but adjust their duration. For instance, if an activity lasts for one and a half hours but began half an hour before the reporting period, we would report it with a duration of one hour. Ideally, we should also mark these truncated activities in some way to indicate that they have been adjusted.

What are your thoughts on this approach?

michelepagot commented 8 months ago

I like the idea to simply truncate intervals crossing the requested repo boundary. About marking such situation in the report, I see it like an accessory idea, not bad or wrong but maybe not strectly needed. About reporting the last 24h instead of using the calendar day, I think that as user I like to have this feature aside the current --today and --yesterday and not as a replacement for them.

P.S. Bartib is amazing, I'm using it daily in the last 3 weeks