mrusme / zeit

Zeit, erfassen. A command line tool for tracking time spent on activities.
https://マリウス.com/zeit-erfassen-a-cli-activity-time-tracker/
GNU General Public License v3.0
237 stars 19 forks source link

Add tasks from the past #29

Open varac opened 1 year ago

varac commented 1 year ago

I haven't found a way to add tasks from i.e. last week. Maybe it's just me, but the docs only show an example how you would add a task that started a few hours ago, not days. Is this possible right now ? If yes, please document an example how to achieve this. If not, please add this option. Thanks !

J-U-B commented 1 year ago

I'm also looking for a way to do that.
I tried:

zeit track -p "TESTS" -t "Zeit-Test" -b '2023-09-11T20:00' -s '2023-09-11T21:00'
zeit track -p "TESTS" -t "Zeit-Test" -b '2023-09-11T20:00:00' -s '2023-09-11T21:00:00'
zeit track -p "TESTS" -t "Zeit-Test" -b '2023-09-11T20:00:00+02:00' -s '2023-09-11T21:00:00+02:00'

But in any case, I get only as a response:

 ▲ could not match passed time

A messy workaround:

zeit track -t DUMMY 
ZID=$(zeit list --no-colors | grep DUMMY|cut -f1 -d ' ' ); echo $ZID
zeit entry ${ZID} -b "2023-09-11T20:00" -s '2023-09-11T21:00'  -t Zeit-Test -p TESTS

That's not pretty, but it works until the problem is fixed.

mrusme commented 1 year ago

In order to use absolute timestamps this function would require a few changes. Right now it only accepts hour formats, ideally however it should accept any given format. Ideally this function should make use of a dedicated library that can do more complex time parsing magic.