---
title: RRule Plugin
---

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](recurring-events).

## Usage with NPM

First, install the `@fullcalendar/rrule` package:

```
npm install --save @fullcalendar/rrule
```

Then, create a new calendar and pass in the plugins:

```js
import { Calendar } from "fullcalendar";
import dayGridPlugin from "fullcalendar/daygrid";
import rrulePlugin from "@fullcalendar/rrule";

let calendarEl = document.getElementById("calendar");
let calendar = new Calendar(calendarEl, {
  plugins: [rrulePlugin, dayGridPlugin],
  events: [
    // event data. see below
  ],
});

calendar.render();
```

## Usage with Script Tags

You can also configure the rrule plugin with [script tags](initialize-globals). This example leverages CDN links:

```html
<!-- rrule lib -->
<script src="https://cdn.jsdelivr.net/npm/rrule@2.6.4/dist/es5/rrule.min.js"></script>

<!-- fullcalendar bundle -->
<script src="https://cdn.jsdelivr.net/npm/fullcalendar@{latestReleases.v7}/all.global.js"></script>

<!-- the rrule-to-fullcalendar connector. must go AFTER the rrule lib -->
<script src="https://cdn.jsdelivr.net/npm/@fullcalendar/rrule@{latestReleases.v7}/global.js"></script>

<script>
  var calendarEl = document.getElementById("calendar");
  var calendar = new FullCalendar.Calendar(calendarEl, {
    events: [
      // event data. see below
    ],
  });

  calendar.render();
</script>
```

<a class='more-link' href='rrule-global-demo'>View a live demo</a>

## Event Data

When using the RRule plugin, [event parsing](event-parsing) accepts these new properties:

<table>
<tbody>
<tr>
<th>rrule</th>
<td>

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.

</td>
</tr>
<tr>
<th>exdate</th>
<td>

A [date input](date-parsing) or array of date inputs.

</td>
</tr>
<tr>
<th>exrule</th>
<td>

An object or array of objects. The object is whatever the `new RRule` constructor takes. [See the RRule docs](https://github.com/jakubroztocil/rrule).

</td>
</tr>
<tr>
<th>duration</th>
<td>

Must be something that [parses into a Duration](duration-object). If not specified, each event will appear to have the default duration. See [defaultAllDayEventDuration](defaultAllDayEventDuration), [defaultTimedEventDuration](defaultTimedEventDuration), and [forceEventDuration](forceEventDuration) for more info.

</td>
</tr>
</tbody>
</table>

## The `rrule` property

You can specify the `rrule` property as an object:

```js
var calendar = new FullCalendar.Calendar(calendarEl, {
  events: [
    {
      title: "my recurring event",
      rrule: {
        freq: "weekly",
        interval: 5,
        byweekday: ["mo", "fr"],
        dtstart: "2012-02-01T10:30:00", // will also accept '20120201T103000'
        until: "2012-06-01", // will also accept '20120201'
      },
    },
  ],
});
```

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 also specify `rrule` as a string:

```js
var calendar = new FullCalendar.Calendar(calendarEl, {
  events: [
    {
      title: "my recurring event",
      rrule:
        "DTSTART:20120201T103000Z\nRRULE:FREQ=WEEKLY;INTERVAL=5;UNTIL=20120601;BYDAY=MO,FR",
    },
  ],
});
```

## Exclusion Properties

As of version `5.5.0`, you can supply properties that exclude certain dates generated by the previously supplied `rrule`. These only work if you're defining `rrule` as an object. If you're defining `rrule` as as string, you should write the exclusions within the string itself.

You can exclude one or more explicit dates using `exdate`:

```js
var calendar = new FullCalendar.Calendar(calendarEl, {
  events: [
    {
      title: "my recurring event",
      rrule: {
        freq: "weekly",
        dtstart: "2012-02-01",
      },
      exdate: ["2012-02-08"], // will also accept a single string
    },
  ],
});
```

Or, you can use a separate rrule to define the dates you want excluded, using `exrule`:

```js
var calendar = new FullCalendar.Calendar(calendarEl, {
  events: [
    {
      title: "my recurring event",
      rrule: {
        freq: "weekly",
        dtstart: "2012-02-01",
      },
      exrule: {
        // will also accept an array of these objects
        freq: "weekly",
        dtstart: "2012-02-15",
        until: "2012-02-22",
      },
    },
  ],
});
```

## Times and Time Zones

The `dtstart` and `until` dates (or `DTSTART` and `UNTIL` when specifying a string) will be parsed in this way:

- If a time part is not specified (like `T10:30:00` or `T103000`), the event is assumed to be all-day.
- If a time zone part is not specified (like `Z`), the event will assume the [timeZone](timeZone) of the calendar.
