Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can iCal schedule an event for the first weekday after BYMONTHDAY if BYMONTHDAY is a weekend?

If I have a recurring event on a given day of the month (i.e. the 15th) and that day falls on a Saturday or a Sunday, is it possible for iCal to instead schedule the event to occur on the next available week day?

like image 286
8bitjunkie Avatar asked Aug 07 '13 10:08

8bitjunkie


2 Answers

you cannot set exception but you can use a combination of byday and bymonthday: something like will give you the monday after a week-end which had either on saturday or sunday a 15th.

RRULE:FREQ=MONTHLY;BYDAY=MO;BYMONTHDAY=16,17

By combining with another event: RRULE:FREQ=MONTHLY;BYDAY=MO,TU,WE,TH,FR;BYMONTHDAY=15

you'll be there

like image 55
Auberon Vacher Avatar answered Oct 17 '22 08:10

Auberon Vacher


Using the BYSETPOS=1 rule part, you can accomplish this in a single event:

RRULE:FREQ=MONTHLY;BYDAY=MO,TU,WE,TH,FR;BYMONTHDAY=15,16,17;BYSETPOS=1

This tells iCal to repeat the event monthly; to repeat it only Monday-Friday; to repeat it only on the 15th-17th; and to repeat it only on the first day (per month) that matches the previous rule parts.

BYSETPOS just tells iCal to choose the Nth occurrence of the set of occurrences matched by the other rule parts. It can be set to a comma separated list of values from 1 to 366 or -366 to -1.

For example, modifying the above rule to have BYMONTHDAY=15,16,17,29,29,30,31 and BYSETPOS=1,-1 will cause the event to repeat on the first weekday on or after the 15th, and the last weekday in the month.

Source: RFC 2445

like image 4
int3h Avatar answered Oct 17 '22 09:10

int3h