jazzband / Watson

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

Make adding past activities easier #278

Open varac opened 5 years ago

varac commented 5 years ago

Right now, adding a past activity needs a lot of typing:

watson add --from "2019-04-24 10:00:00" --to "2019-04-24 11:00:00" project1 +task1

even when adding an activity from today.

It would be nice if you don't need to provide the full date+time, and watson would gracefully accept i.e. for today:

watson add --from "10:00:00" --to "11:00:00" project1 +task1
watson add --from "10" --to "11" project1 +task1

or sth like this:

watson add --from "yesterday 10:00" --to "yesterday 11:00" project1 +task1
jmaupetit commented 5 years ago

I do agree with you, this would be lovely! Do you have time to work on a PR for this?

varac commented 5 years ago

@jmaupetit Sorry, not the time nor the python skills needed :/

jmaupetit commented 5 years ago

No worries, we'll find time/a volunteer to implement this feature.

davidag commented 5 years ago

Arrow's date/time creation alternatives don't seem to accept a "humanized" string as input.

I imagine that it's far easier to generate a localized and humanized date from a given date, than it is to parse one into a date. This might be a good starting point to search on the Internet.

jdckr commented 5 years ago

I have issued PR #282 which adds possibility to use times only or one datetime and a time. Check documentation inside PR for more information.

prat0088 commented 4 years ago

I just tried out watson and encountered this issue within the first minute. It's so very cumbersome to add time due to the verbose date format requirements.

I would love to help out getting this issue through. It looks like there are a series of PRs in various states:

@davidag What's needed to get these PRs merged and this issue closed? Is there anything I can help out with?

davidag commented 4 years ago

@prat0088 PR #316 should be ready to be merged. When that's merged, PR #328 should go next making date input a bit more usable.

corbolais commented 4 years ago

Without digging into the PRs given above, can I use the following?

watson add -f "todayT03:45"
watson add -f "todayT03h45"
watson add -f "yesterdayT..."
watson add -f "todayTnoon"

etc.

davidag commented 4 years ago

@corbolais No, that syntax is not permitted.

michaelbeaumont commented 4 years ago

It looks like https://github.com/scrapinghub/dateparser supports parsing these strings into datetime.datetimes