Calendar Component RRule
The rrule
property on events can be an object or a correctly formatted string. Not all of the abilities of RRule are available when using the object such as EXDATE.
RRule object
If the rrule property is defined as an object the following options are available:
Option | Description |
---|---|
freq | (required) One of the following values: yearly, monthly, weekly, daily, hourly, minutely, secondly |
dtstart | The recurrence start. Besides being the base for the recurrence, missing parameters in the final recurrence instances will also be extracted from this date. If not given, now will be used instead. |
interval | The interval between each freq iteration. For example, when using yearly , an interval of 2 means once every two years, but with hourly , it means once every two hours. The default interval is 1 . |
wkst | The week start day. Must be a string value like MO, TU, WE or an integer, specifying the first day of the week. This will affect recurrences based on weekly periods. The default week start is MO . |
count | How many occurrences will be generated. |
until | The recurrence end. |
tzid | If given, this must be a string supported by Luxon, and the Luxon library must be provided. |
bysetpos | If given, it must be either an integer, or an array of integers, positive or negative. Each given integer will specify an occurrence number, corresponding to the nth occurrence of the rule inside the frequency period. For example, a bysetpos of -1 if combined with a monthly frequency, and a byweekday of (MO , TU , WE , TH , FR ), will result in the last work day of every month. |
bymonth | If given, it must be either an integer, or an array of integers, meaning the months to apply the recurrence to. |
bymonthday | If given, it must be either an integer, or an array of integers, meaning the month days to apply the recurrence to. |
byyearday | If given, it must be either an integer, or an array of integers, meaning the year days to apply the recurrence to. |
byweekno | If given, it must be either an integer, or an array of integers, meaning the week numbers to apply the recurrence to. Week numbers have the meaning described in ISO8601, that is, the first week of the year is that containing at least four days of the new year. |
byweekday | If given, it must be either an integer (0 == MO ), an array of integers, one of the weekday values (MO , TU , etc), or an array of these constants. When given, these variables will define the weekdays where the recurrence will be applied. |
byhour | If given, it must be either an integer, or an array of integers, meaning the hours to apply the recurrence to. |
byminute | If given, it must be either an integer, or an array of integers, meaning the minutes to apply the recurrence to. |
bysecond | If given, it must be either an integer, or an array of integers, meaning the seconds to apply the recurrence to. |
RRule String
*** THIS FEATURE IS CURRENTLY NOT WORKING DUE TO AN ISSUE WITH THE UNDERLYING FULLCALENDAR LIBRARY ***
A string in the format defined by RFC 5545.
When using the EXDATE property each date to be excluded must be provided as separate values separated by a \n
Some examples are provided below.
Example 1: Every week at 11am starting 8th March 2021 and ending 12th April 2021 – DTSTART:20210308T110000Z\nRRULE:FREQ=WEEKLY;UNTIL=20220330T120000Z
Example 2: Every week at 12pm starting 8th March 2021 and ending 20th April 2021 except for 24th March 2021 – DTSTART:20210310T120000Z\nRRULE:FREQ=WEEKLY;UNTIL=20210420T120000Z\nEXDATE:20210324T120000Z
Example 3: Every day at 12am starting 19th March 2021 until 25th March 2021 except for 20th March 2021 and 23rd March 2021 – DTSTART:20210319T000000Z\nRRULE:FREQ=DAILY;UNTIL=20210325T000000Z;INTERVAL=1\nEXDATE:20210320T000000Z\nEXDATE:20210323T000000Z
Example 4: The first Monday and last Friday of every month for the year 2021 – DTSTART:20210101\nRRULE:UNTIL=20211231;FREQ=MONTHLY;INTERVAL=1;BYDAY=1MO,-1FR