Closed obbardc closed 4 years ago
I am close to publishing a new version with this feature. But I have a question: I am going to add more "special" dates(besides tomorrow|tmr|tm
and today
) and I am not sure how to make them easy to understand. I added weekdays: --set-due=fri
and --set-due=next-fri
. What real due date do you expect from both commands for a date 2020-07-10
that is Friday? At this moment it is ambiguous(I can interpret fri
and next-fri
in two ways).
While testing out the new feature today I didn't give it much thought and tried "due:tuesday". That is not recognized at the moment.
We might think about adding full day names for "due:" in addition to the abbreviation.
I agree. It makes sense.
I took a look around the net what other implementations do. While there are quite a few parsers, many of them don't handle cases like "Monday after two weeks", just plain "Monday".
Two examples:
TaskWarrior: Too many hardly used knobs IMHO: https://taskwarrior.org/docs/dates.html https://taskwarrior.org/docs/named_dates.html
Official PHP implementation: https://www.php.net/manual/en/datetime.formats.relative.php https://www.php.net/manual/en/function.strtotime.php
echo strtotime("next Thursday"), "\n"
-> Thursday this week (if NOW is f.e. Tuesday)
I'll also ask coworkers tomorrow regarding https://github.com/VladimirMarkelov/ttdl/issues/28#issuecomment-657252837
Thank you for research! It seems that having bot "DAY_OF_WEEK" and "next DAY_OF_WEEK" adds ambiguity. So, we can keep simple WEEKDAY without any prefix and always choose this DAYOFWEEK in the future(in other words, it is always neither in the past not today).
I agree keeping it simple is best. Friday should mean the next Friday in the calender, if I wanted it to be set to any other Friday I should have to put in a date.
On Tue, 14 Jul 2020, 22:51 Vladimir Markelov, notifications@github.com wrote:
Thank you for research! It seems that having "next DAY_OF_WEEK" adds ambiguity. So, we can keep simple WEEKDAY without any prefix and always choose this DAYOFWEEK in the future(in other words, it is always neither in the past not today).
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/VladimirMarkelov/ttdl/issues/28#issuecomment-658431354, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAH3LVVBUSWUGNTIMAHKQR3R3THKXANCNFSM4OOXWY6A .
OK. It seems done. If it looks good, I will publish new version. The current rules:
Numbers (shortcuts):
single number
= day of monthnumber-number
= month-day of monthIn some time interval
d
, w
, m
, y
= in number
days, weeks, months, years. Items can be combined: 1w3d
- kind of a week and a half = in 10 days (you also can set it with 10d
m
and y
always sets the due date to the end of resulting month.Named:
today
, tomorrow
, and day of week
Extra rules:
day of week
can be full word, or abbreviated to 2 or 3 first letterstoday
all other dates are always in the futuresingle number
or month-day
to 31 always sets the due date to the last day of month. So, one does not have to remember how many days the current month has. It is a bit simplified description but you get the ideaI think the new rules are perfect. Great job!
Personally I'll probably use "tuesday" or "14d" the most: A task is either on a fixed day soon or something more vague like "in two weeks". Example: "check bicycle tire pressure due:30d"
Thank you all for the discussion. Closing the issue as done one.
Currently the
--set-due
argument requires a date, it'd be nicer if it could accept a human-readable form like:--set-due=tomorrow --set-due=3d --set-due=1w --set-due=1m