In Google Calendar, using rrule
, I want to make recurrent events for two consecutive days:
What I would expect to match my requirement is any of the 2 options below:
Possible option | 1st match | 2nd match |
---|---|---|
1 | fri 30 - sat 1 | fri 14 - sat 15 |
2 | fri 7 - sat 8 | fri 21 - sat 22 |
The below config shows what I have tried and the screenshot shows the outcome which is certainly not what I want.
The tricky part I believe is when the two days belong to 2 different moths. Luckily I noticed this since it was the case this May.
Any idea how to solve this?
BEGIN:VCALENDAR
VERSION:2.0
BEGIN:VEVENT
RRULE:FREQ=MONTHLY;INTERVAL=1;BYDAY=FR;BYSETPOS=1
SUMMARY:EventDay1
DTSTART;VALUE=DATE:20210501
SEQUENCE:0
DESCRIPTION:EventDay1
END:VEVENT
BEGIN:VEVENT
RRULE:FREQ=MONTHLY;INTERVAL=1;BYDAY=FR;BYSETPOS=3
SUMMARY:EventDay1
DTSTART;VALUE=DATE:20210501
SEQUENCE:0
DESCRIPTION:EventDay1
END:VEVENT
BEGIN:VEVENT
RRULE:FREQ=MONTHLY;INTERVAL=1;BYDAY=SA;BYSETPOS=1
SUMMARY:EventDay2
DTSTART;VALUE=DATE:20210501
SEQUENCE:0
DESCRIPTION:EventDay2
END:VEVENT
BEGIN:VEVENT
RRULE:FREQ=MONTHLY;INTERVAL=1;BYDAY=SA;BYSETPOS=3
SUMMARY:EventDay2
DTSTART;VALUE=DATE:20210501
SEQUENCE:0
DESCRIPTION:EventDay2
END:VEVENT
END:VCALENDAR
You could use BYMONTHDAY
instead of BYSETPOS
to specify the first and third weeks of the month:
BYMONTHDAY=1,2,3,4,5,6,7
BYMONTHDAY=2,3,4,5,6,7,8
BYMONTHDAY=15,16,17,18,19,20,21
BYMONTHDAY=16,17,18,19,20,21,22
Arguably less elegant than BYSETPOS
, but it solves the issue:
BEGIN:VCALENDAR
VERSION:2.0
BEGIN:VEVENT
RRULE:FREQ=MONTHLY;INTERVAL=1;BYDAY=FR;BYMONTHDAY=1,2,3,4,5,6,7
SUMMARY:EventDay1
DTSTART;VALUE=DATE:20210430
EXDATE;VALUE=DATE:20210430
SEQUENCE:0
DESCRIPTION:EventDay1
END:VEVENT
BEGIN:VEVENT
RRULE:FREQ=MONTHLY;INTERVAL=1;BYDAY=FR;BYMONTHDAY=15,16,17,18,19,20,21
SUMMARY:EventDay1
DTSTART;VALUE=DATE:20210430
EXDATE;VALUE=DATE:20210430
SEQUENCE:0
DESCRIPTION:EventDay1
END:VEVENT
BEGIN:VEVENT
RRULE:FREQ=MONTHLY;INTERVAL=1;BYDAY=SA;BYMONTHDAY=2,3,4,5,6,7,8
SUMMARY:EventDay2
DTSTART;VALUE=DATE:20210430
EXDATE;VALUE=DATE:20210430
SEQUENCE:0
DESCRIPTION:EventDay2
END:VEVENT
BEGIN:VEVENT
RRULE:FREQ=MONTHLY;INTERVAL=1;BYDAY=SA;BYMONTHDAY=16,17,18,19,20,21,22
SUMMARY:EventDay2
DTSTART;VALUE=DATE:20210430
EXDATE;VALUE=DATE:20210430
SEQUENCE:0
DESCRIPTION:EventDay2
END:VEVENT
END:VCALENDAR