VladimirMarkelov / ttdl

TTDL - Terminal Todo List Manager
MIT License
210 stars 17 forks source link

[Fetaure Request] Add work days as a recurrence interval type #91

Closed tchamade61 closed 7 months ago

tchamade61 commented 7 months ago

Currently, a recurrent task can be set to repeat every day, week, month or year. Would it be possible to add an additional interval type, say b for example, that would cause tasks to be regenerated only on work days? This would allow a user to create daily work tasks that do not recur on weekends, when the user is not at work.

As an example, assuming that Monday thru Friday are workdays and Saturdays and Sundays are weekends, I would like the ability to add a task like this: arrive at work due:today rec:+1b

When the task is completed, the task would recur on the next work day instead of the next calendar day. In the example above, a task completed on Monday would recur on Tuesday, while a task completed on Friday would recur on Monday. As it stands now, using the rec:+1d tag generates 2 "extra" tasks on Saturday and Sunday that I do need because I am not at work.

It would be a nice touch to have the work day interval available in the threshold tag as well as the recurrent tag.

Thank you.

Also, thank you to all who have contributed to this project!

VladimirMarkelov commented 7 months ago

An interesting idea. I see it useful at times. Though, there is a big question: "How to determine what days to skip?".

The most interesting part is holidays. If you want to skip weekends, I guess you also want to skip days like Xmas. Some holidays fall on the same day every year (almost always because of rare case when an extra day-off is added thanks to the holiday happens on Tuesday or Thursday), but some are defined like "the second Monday of some month". Also we should not forget that people in different countries celebrate holidays often on different days, so providing a hard-coded rules does not look good. To make the task more difficult, sometimes a weekend is really a working day.

tchamade61 commented 7 months ago

I agree that adding support for holidays would be a very challenging task. Since they occur less frequently than weekends, I was not considering holidays as part of the request. For my needs, the ability to skip weekends is adequate.

On Wed, Feb 14, 2024 at 12:56 AM Vladimir Markelov @.***> wrote:

An interesting idea. I see it useful at times. Though, there is a big question: "How to determine what days to skip?".

The most interesting part is holidays. If you want to skip weekends, I guess you also want to skip days like Xmas. Some holidays fall on the same day every year (almost always because of rare case when an extra day-off is added thanks to the holiday happens on Tuesday or Thursday), but some are defined like "the second Monday of some month". Also we should not forget that people in different countries celebrate holidays often on different days, so providing a hard-coded rules does not look good. To make the task more difficult, sometimes a weekend is really a working day.

— Reply to this email directly, view it on GitHub https://github.com/VladimirMarkelov/ttdl/issues/91#issuecomment-1943129652, or unsubscribe https://github.com/notifications/unsubscribe-auth/AKETOTAW37JFRGCM2NVLQX3YTRGXDAVCNFSM6AAAAABDGQYHI2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSNBTGEZDSNRVGI . You are receiving this because you authored the thread.Message ID: @.***>

-- Matt Email @.) @.>

VladimirMarkelov commented 7 months ago

Good point. Let's start with a simple case. It shouldn't be too hard.

VladimirMarkelov commented 7 months ago

I have published a new version 4.2.0 at crates.io - it should skip Saturdays and Sundays when you use b as a recurrence interval