taskwarrior
taskwarrior copied to clipboard
Add an "end of period" date modifier
I find there are a number of cases where one may want to set a due date at the end of a given period, e.g. to add a task due:
- today, end of day
- tomorrow, end of day
- March, end of month
- 2024, end of year
There are several eo- shortcuts covering some of these cases (https://github.com/GothenburgBitFactory/libshared/blob/master/src/Datetime.cpp#L551), but they mostly help setting a date at the end of a given day. What I find is missing is a general "end of period" modifier, which completes the unspecified parts of a date with the latest possible value, instead of the earliest one.
Some examples with clarify. Let's assume the "end of period" modifier is ]. Then:
due:today]means today at 23:59:59due:tomorrow]means tomorrow at 23:59:59due:march]means2022-03-31 23:59:59due:2024]means2024-12-31 23:59-59
Something similar was already mentioned here: https://github.com/GothenburgBitFactory/taskwarrior/issues/179#issuecomment-365012602, but that was about an "end of day" modifier, not an "end of period".
For symmetry a "beginning of period" modifier (say [) could be implemented, but I don't really see the point given that "beginning of" is the default behavior.
I often find that I want to schedule tasks to be due by the end of tomorrow, and have to use due:eod+1d, which isn't too hard to write, but I'd love to be able to use eot. By contrast, tomorrow] seems like a lot of typing, but I do like the idea of having a generic way to do this.