GothenburgBitFactory / taskwarrior

Taskwarrior - Command line Task Management
https://taskwarrior.org
MIT License
4.46k stars 306 forks source link

[TW-1717] Adding firstmonday, lastmonday, etc. for recurring tasks #1741

Open taskwarrior opened 6 years ago

taskwarrior commented 6 years ago

Ronny Ager-Wick on 2013-05-11T10:33:51Z says:

Basically I would like to be able to say:

task add Pay my bill due:2013.05.16 recur:thirdthursday

This should make the task recur every third Thursday of the month. The supported syntax would be:

[first|second|third|forth|fifth|last|secondlast|thirdlast|forthlast|fifthlast][mon|tues|wednes|thurs|fri|satur|sun]day

For brevity we could also support 1st, 2nd, 3rd, 2ndlast, 3rdlast, etc. and mon, tue, wed, etc. instead of the whole weekday name. We could also add "weekday" and "weekend" as aliases for [mon|tue|wed|thu|fri] and [sat|sun] respectively. So basically:

[first|1st|second|2nd|third|3rd|forth|4th|fifth|5th|last|secondlast|2ndlast|thirdlast|3rdlast|forthlast|4thlast|fifthlast|5thlast][[mon|tues|wednes|thurs|fri|satur|sun]day]|[mon|tue|wed|thu|fri|sat|sun]|weekday|weekend]

This will make taskwarrior capable of the type of recurring tasks most GUI based task managers already support. Additional interesting combinations would be things like: recur:lastsaturday+2d, which would be the first Monday after the last Saturday of the month, which is something most GUI task manager do not support. I would personally use a lot of due dates in the format recur:secondfriday-7d or recur:2ndfri-7d to give me a few days to do what is needed for the meeting that occurs every second Friday of the month. I thought of this because I needed to add a task with recur:lastweekend-2 and another with recur:2ndmonday, which I have to hack for now by recurring on the 20th of the month, which would land some time before the last weekend and 8th of the month, which would be on or before the 2nd Monday. Not ideal, but a workaround for now :)

There's also a potential to simplify with a syntax like this:

task add Pay my bill due:2013.05.11 recur:beginningofmonth
task add Pay my bill due:2013.05.11 recur:endofmonth

The weekday in question would be determined by the due date and "beginningofmonth" and "endofmonth" would specify whether we should count from the beginning or the end of month, so the first example would be equivalent to recur:secondsaturday and the second example would be equivalent to recur:thirdlastsaturday.

Note: there is a very high chance that better terminology can be thought up - this is just what I though of right now, used just to demonstrate the functionality. Maybe recur:monthly_weekday_ascending and recur:monthly_weekday_descending? Anyway :)

taskwarrior commented 6 years ago

Migrated metadata:

Created: 2013-05-11T10:33:51Z
Modified: 2017-01-16T18:12:15Z
taskwarrior commented 6 years ago

Paul Beckingham on 2013-09-29T18:20:07Z says:

Good suggestion. I'm assigning this to the libkronisk project, which is where this will eventually be solved. I don't like the number of permutations this might require, and hope a better way can be found, but this kind of date math is essential for several projects.

Thanks.

taskwarrior commented 6 years ago

Paul Beckingham on 2015-10-21T12:09:22Z says:

Relocated to the Taskwarrior project, which is where this will be implemented.

mhalano commented 3 years ago

Maybe this could be implemented in time for 2.6.0 release because of the recurrence overhaul? I have a task to do at the first Tuesday of each month, but I'm afraid for now there is no way to configure this recurrence.

bstaz commented 6 months ago

Would love to see this added. I have multiple tasks that happen on the 1st/2nd Saturday, etc., that I currently schedule manually.