# RRule Plugin

> FullCalendar v4 documentation, for an old release. Web version: https://legacy.fullcalendar.io/v4/rrule-plugin
>
> Latest version (v7): https://fullcalendar.io/docs/rrule-plugin.md

The RRule plugin is a connector to the [rrule js library](https://github.com/jakubroztocil/rrule). It is powerful for specifying recurring events, moreso than FullCalendar's built-in [simple event recurrence](https://legacy.fullcalendar.io/v4/recurring-events.md).

It introduces some new [event properties](https://legacy.fullcalendar.io/v4/event-parsing.md):

```js
import { Calendar } from '@fullcalendar/core';
import rrulePlugin from '@fullcalendar/rrule';
...
let calendar = new Calendar(calendarEl, {
  plugins: [ rrulePlugin ],
  events: [
    {
      // standard property
      title: 'my recurring event',

      rrule: 'DTSTART:20120201T103000Z\nRRULE:FREQ=WEEKLY;INTERVAL=5;UNTIL=20120601;BYDAY=MO,FR',
      // ...or, an object...
      rrule: {
        freq: 'weekly',
        interval: 5,
        byweekday: [ 'mo', 'fr' ],
        dtstart: '2012-02-01T10:30:00',
        until: '2012-06-01'
      },

      // for specifying the end time of each instance
      duration: '02:00'
    }
  ]
});
...
```

If you are using `<script>` tags and browser globals, you must ensure the original non-plugin `rrule.js` dist file [from the rrule site](https://jakubroztocil.github.io/rrule/) is included on your page first.

The `rrule` property accepts whatever the rrule lib accepts for a `new RRule`. [See the RRule docs](https://github.com/jakubroztocil/rrule). You can specify a string or an object. When specifying a string, you **can** use date and date-time formats in the [basic ISO8601 format](https://en.wikipedia.org/wiki/ISO_8601#Calendar_dates). With objects on the contrary, you **must** use the extended ISO8601 format (with hyphens).

If you're specifying an object, you can write some of the properties in a way that's more convenient than what rrule requires:

- You don't need to use the RRule constants like `RRule.WEEKLY`. You can just specify the string `'weekly'`. This is better for JSON serialization.
- You can specify `dtstart` as an [ISO8601 string](https://legacy.fullcalendar.io/v4/date-parsing.md) in the [extended format](https://en.wikipedia.org/wiki/ISO_8601#Calendar_dates). If the string does not have a time part, the event will be all-day. If it **DOES** have a time part, it will determine each recurrence's start time. Also, if it doesn't have a UTC offset, it will be parsed according to the current [timeZone](https://legacy.fullcalendar.io/v4/timeZone.md).
- You can specify `until` as an [ISO8601 string](https://legacy.fullcalendar.io/v4/date-parsing.md) in the [extended format](https://en.wikipedia.org/wiki/ISO_8601#Calendar_dates). If it doesn't have a UTC offset, it will be parsed according to the current [timeZone](https://legacy.fullcalendar.io/v4/timeZone.md).

The `duration` property must be something that [parses into a Duration](https://legacy.fullcalendar.io/v4/duration-object.md). If not specified, each event will appear to have the default duration. See [defaultAllDayEventDuration](https://legacy.fullcalendar.io/v4/defaultAllDayEventDuration.md), [defaultTimedEventDuration](https://legacy.fullcalendar.io/v4/defaultTimedEventDuration.md), and [forceEventDuration](https://legacy.fullcalendar.io/v4/forceEventDuration.md) for more info.
