Watson icon indicating copy to clipboard operation
Watson copied to clipboard

Make adding past activities easier

Open varac opened this issue 5 years ago • 10 comments

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

varac avatar Apr 29 '19 11:04 varac

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

jmaupetit avatar Apr 29 '19 12:04 jmaupetit

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

varac avatar Apr 29 '19 12:04 varac

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

jmaupetit avatar Apr 29 '19 12:04 jmaupetit

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.

davidag avatar May 09 '19 15:05 davidag

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.

jdckr avatar May 13 '19 21:05 jdckr

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:

  • #282 Adds time-only support and tests,, but it's stalled since May 22nd, 2019
  • #316 Adds unit tests for the date format, but it hasn't seen activity since Oct 7th, 2019

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

prat0088 avatar Nov 08 '19 22:11 prat0088

@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.

davidag avatar Nov 25 '19 23:11 davidag

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.

corbolais avatar Apr 06 '20 21:04 corbolais

@corbolais No, that syntax is not permitted.

davidag avatar Apr 07 '20 18:04 davidag

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

michaelbeaumont avatar Aug 14 '20 10:08 michaelbeaumont