Multiple tasks in a week - emacs

How do I specify a task in org-mode as needing to be done 3 times a week without being specific about which day of the week it is?
Org-mode documentation for repeated tasks suggests the use of y/m/d/h intervals, but I didn't find the syntax for specifying an event n times per interval.

You can define your TODO as a habit in org:
The TODO may also have minimum and maximum ranges specified by
using the syntax `.+2d/3d', which says that you want to do the
task at least every three days, but at most every two days.
Maybe this would serve your purpose?

Related

iCalendar: How to exclude a time range from a RRULE?

I would like to exclude a time range from a RRULE.
For example the RRULE:
DTSTART;VALUE=DATE-TIME:20210104T142711Z
RRULE:FREQ=HOURLY;INTERVAL=2
will create a recurrent event every two hours, but I would like to exclude a period of time during the night, for example from 22:00 to 6:00.
I have read how to exclude dates using the EXDATE property, but I have not found information in the RFC about how to exclude a period of time. Is this documented somewhere or is there a recommended way of doing this?
I suggest try
RRULE:FREQ=DAILY;BYHOUR=6,8,10,12,14,16,18,20
and test in all the applications you expect to deal with this. Some calendar applications don't do FREQ=HOURLY. EG:Last I looked, google didn't do FREQ=HOURLY. I don't know about BYHOUR. Test whether the applications will do BYHOUR?
This https://icalendar.org/iCalendar-RFC-5545/3-3-10-recurrence-rule.html explains the limiting or expanding of the number of recurrences.
If those are not accepted by your intended receiving applications, then another approach may be to generate multiple VEVENTS for each hour, all using FREQ=DAILY.

Scheduling a job to run every Nth week and specific week days starting on specific date with Quartz (Scala)

In continuation of:
What is the most reliable way to schedule a job with cron scheduler is Quartz that repeats every N days starting from a specific date
&
Absolutely unexplainable results for cron based scheduler in Quartz
There is another question regarding possibilities of scheduling with quartz. And the difference between the two above and this one and the fact that I am trying to execute more than a single job for the target period (e.g. Mon, Fri every 4th week)
Let's assume that a user needs to execute a task every 4th week on Wednesday & Friday starting from a specific date.
Of course, I can setup a cron scheduler that will look something like this:
0 0 12 ? 1/4 WED,FRI *
But we are beck to the same problem as described in the linked posts. What this cron expression really mean, is execute the job on Wednesday & Friday of every 4th week of the month.
Another option is to use, calendar interval schedule builder (the perfectly resolves the problem for as long as there is only one day of the week that needs to be considered); however, it does not allow to specify days of a week, but simply calculates the true 4 weeks worth of time based on the start date.
How, if possible, to schedule a job with Quartz, that will be executed every 4th (or any Nth week) on more than a single day of the week? Is it possible to achieve it without multiple triggers?
Thanks,
So, after long digging around, it seems like the only way to solve it with existing Quartz tools is to manage this type of scheduling with more that one trigger (one for every weekday).
Hopefully that helps somebody.

iCal rrule for two different lengths

I want to enter an event in my calendar that runs on Monday and Tuesdays from 8-3 and Saturdays from 8-12 every week. My app is supporting rrule's. Is it possible to pack that into a single rrule?
If it would be only the weekdays, then the rule would be simple and do look like:
FREQ=WEEKLY;BYDAY=MO,TU
Any hints are appreciated.
The duration of the event is not part of the rrule definition but is rather determined by the DTSTART/DTEND or DTSTART/DURATION combinations so there is no way to have one single event representing what you want (unless you create exceptions for every single instances on Saturday)
The best you can do is to use the RELATED-TO property (https://www.rfc-editor.org/rfc/rfc5545#section-3.8.4.5) to link the 2 events.

iCalendar recurrence rule for event that occurs every two years in multiple months on first weekend day

Is it possible to specify an event to occur on the 1st weekend day of multiple months every 2 years in a single RRULE? Using February and September as a test case, my first thought was:
FREQ=YEARLY;DTSTART=20140320T070000Z;INTERVAL=2;BYSETPOS=1;BYMONTH=2,9;BYDAY=SA,SU
but BYSETPOS reduces the set down to February only. I thought changing the freq to monthly would do the trick after I posted here, but applying an interval of 2 for every other year messes things up because the interval is applied to a monthly freq instead of a yearly freq.
I made this a new question because I did not include interval in my original question.
I think splitting this into multiple rrules would work, but it would greatly increase the complexity of this area of my app so I was hoping for a single rrule with a yearly freq.
Thanks!
FWIW, and since you mention it as a potential workaround, RFC5545 has removed the ability to have multiple RRULE property in a single VEVENT/VTODO (https://www.rfc-editor.org/rfc/rfc5545#section-3.6.1). It was there in RFC2445.
Then, unless someone finds a very elegant and simple solution, you may be left with something that is so convoluted that most clients will barf on it (don't know how interoperability is important to you).
This leaves you with 2 choices I think:
either use 2 different events (maybe linked with a RELATED-TO property)
or, if you can bound the event to a certain number of instances, represent it as a set of RDATE (or RRULE + RDATE, or RRULE + EXDATE, etc...).
Adding BYSETPOS like this may work as you intend:
FREQ=YEARLY;INTERVAL=2;BYMONTH=2,9;BYDAY=+1SA,+1SU;BYSETPOS=1,3
what you could try is to take advantage of the fact that bysetpos allows you to select within the year the selected instances of your rule, then you could limit the number of instances to the first week of the month (by setting the days of the month to the first 6 ones) to avoid the cases where month have more or less weeks, which then allows you to select the first and third instance in your year.
Which then gives:
DTSTART:20140320T060000Z
FREQ=YEARLY;INTERVAL=2;WKST=MO;BYSETPOS=1,3;BYMONTH=2,9;BYMONTHDAY=1,2,3,4,5,6,7;BYDAY=SA,SU
which will be:
Sat 2014/Sept/6
Sat 2016/Feb/6
Sat 2016/Sep/3
...
Sun 2024/Sep/1
this was verified with dateutil-python and http://jkbr.github.io/,

complex habit scheduling in orgmode

There are a few complex habits/tasks that I wish orgmode to handle, and I'm not quite sure how to program them:
A habit that has to be done twice a day, between certain hours (E.g. 8-9 and 18-19).
A habit that has to be done over the weekend (Between Thursday-Saturday).
A task that occurs every 6 months, twice a day between certain hours, for a duration of 21 days total.
Can someone help with adding the right SCHEDULE?
Weekend only habit:
SCHEDULED: <2013-12-13 Fri ++1w/2d>
This will cause it to repeat every Friday (regardless of when completed), and will be late if delayed by more than 2 days after the next notification.
Twice a day habit:
This will most likely have to be created as two separate habits, one for the first timeframe and one for the second.
Bi-annual:
Most likely requires two TODO's as well to allow for the two timeframes. I'm not sure if there's any real way of doing so without using complex diary SEXPs which you would have to create every 6 months (or update the SEXP to match the next 6 month span). Org TODOs/Habits don't usually include an 'end-date' when they repeat.