Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
tchamade61 opened this issue Feb 13, 2024 · 4 comments
Closed

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

tchamade61 opened this issue Feb 13, 2024 · 4 comments

Comments

@tchamade61
Copy link

tchamade61 commented Feb 13, 2024

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
Copy link
Owner

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
Copy link
Author

tchamade61 commented Feb 14, 2024 via email

@VladimirMarkelov
Copy link
Owner

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

VladimirMarkelov added a commit that referenced this issue Feb 15, 2024
VladimirMarkelov added a commit that referenced this issue Feb 15, 2024
VladimirMarkelov added a commit that referenced this issue Feb 15, 2024
@VladimirMarkelov
Copy link
Owner

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants