---
title: RecurrenceRule
description: Recurrence rule used with reminders and calendar events.
---

Recurrence rule used with reminders and calendar events.

A recurrence rule specifies how often a reminder or a calendar event should repeat.

## Methods

<span id="complexmonthly" class="api-anchor"></span>

### complexMonthly(interval, daysOfTheWeek, daysOfTheMonth, setPositions)

Constructs a complex monthly recurrence rule.

```typescript
static complexMonthly(interval: number, daysOfTheWeek: [number], daysOfTheMonth: [number], setPositions: [number]): RecurrenceRule
```

The interval should have a value greater than 0 and specifies how often the pattern repeats. For example, an interval of 1 specifies that the rule should repeat every month and a value of 3 specifies that the rule should repeat every third month.

The setPositions filters which recurrences to include in the rule's frequency. For example, a yearly recurrence rule that has a daysOfTheWeek value that specifies Monday through Friday and setPositions contain 2 and -1, occurs only on the second weekday and last weekday of every year.

#### Parameters

**`interval` `number`**

Interval at which to repeat the rule.

**`daysOfTheWeek` `[number]`**

Days of the week to repeat the rule. Values range from 1 to 7, with Sunday being 1.

**`daysOfTheMonth` `[number]`**

Days of the month to repeat the rule. Values range from 1 to 31 and from -1 to -31.

**`setPositions` `[number]`**

Filters which recurrences to include in the rule's frequency.

#### Return value

**`RecurrenceRule`**

Constructed recurrence rule.

<span id="complexmonthlyenddate" class="api-anchor"></span>

### complexMonthlyEndDate(interval, daysOfTheWeek, daysOfTheMonth, setPositions, endDate)

Constructs a complex monthly recurrence rule with an end date.

```typescript
static complexMonthlyEndDate(interval: number, daysOfTheWeek: [number], daysOfTheMonth: [number], setPositions: [number], endDate: Date): RecurrenceRule
```

The interval should have a value greater than 0 and specifies how often the pattern repeats. For example, an interval of 1 specifies that the rule should repeat every month and a value of 3 specifies that the rule should repeat every third month.

The setPositions filters which recurrences to include in the rule's frequency. For example, a yearly recurrence rule that has a daysOfTheWeek value that specifies Monday through Friday and setPositions contain 2 and -1, occurs only on the second weekday and last weekday of every year.

#### Parameters

**`interval` `number`**

Interval at which to repeat the rule.

**`daysOfTheWeek` `[number]`**

Days of the week to repeat the rule. Values range from 1 to 7, with Sunday being 1.

**`daysOfTheMonth` `[number]`**

Days of the month to repeat the rule. Values range from 1 to 31 and from -1 to -31.

**`setPositions` `[number]`**

Filters which recurrences to include in the rule's frequency.

**`endDate` `Date`**

Date at which the recurrence rule should end.

#### Return value

**`RecurrenceRule`**

Constructed recurrence rule.

<span id="complexmonthlyoccurrencecount" class="api-anchor"></span>

### complexMonthlyOccurrenceCount(interval, daysOfTheWeek, daysOfTheMonth, setPositions, occurrenceCount)

Constructs a complex monthly recurrence rule with an occurrence count.

```typescript
static complexMonthlyOccurrenceCount(interval: number, daysOfTheWeek: [number], daysOfTheMonth: [number], setPositions: [number], occurrenceCount: number): RecurrenceRule
```

The interval should have a value greater than 0 and specifies how often the pattern repeats. For example, an interval of 1 specifies that the rule should repeat every month and a value of 3 specifies that the rule should repeat every third month.

The setPositions filters which recurrences to include in the rule's frequency. For example, a yearly recurrence rule that has a daysOfTheWeek value that specifies Monday through Friday and setPositions contain 2 and -1, occurs only on the second weekday and last weekday of every year.

#### Parameters

**`interval` `number`**

Interval at which to repeat the rule.

**`daysOfTheWeek` `[number]`**

Days of the week to repeat the rule. Values range from 1 to 7, with Sunday being 1.

**`daysOfTheMonth` `[number]`**

Days of the month to repeat the rule. Values range from 1 to 31 and from -1 to -31.

**`setPositions` `[number]`**

Filters which recurrences to include in the rule's frequency.

**`occurrenceCount` `number`**

Number of times the rule should repeat before it ends.

#### Return value

**`RecurrenceRule`**

Constructed recurrence rule.

<span id="complexweekly" class="api-anchor"></span>

### complexWeekly(interval, daysOfTheWeek, setPositions)

Constructs a complex weekly recurrence rule.

```typescript
static complexWeekly(interval: number, daysOfTheWeek: [number], setPositions: [number]): RecurrenceRule
```

The interval should have a value greater than 0 and specifies how often the pattern repeats. For example, an interval of 1 specifies that the rule should repeat every week and a value of 3 specifies that the rule should repeat every third week.

The setPositions filters which recurrences to include in the rule's frequency. For example, a yearly recurrence rule that has a daysOfTheWeek value that specifies Monday through Friday and setPositions contain 2 and -1, occurs only on the second weekday and last weekday of every year.

#### Parameters

**`interval` `number`**

Interval at which to repeat the rule.

**`daysOfTheWeek` `[number]`**

Days of the week to repeat the rule. Values range from 1 to 7, with Sunday being 1.

**`setPositions` `[number]`**

Filters which recurrences to include in the rule's frequency.

#### Return value

**`RecurrenceRule`**

Constructed recurrence rule.

<span id="complexweeklyenddate" class="api-anchor"></span>

### complexWeeklyEndDate(interval, daysOfTheWeek, setPositions, endDate)

Constructs a complex weekly recurrence rule with an end date.

```typescript
static complexWeeklyEndDate(interval: number, daysOfTheWeek: [number], setPositions: [number], endDate: Date): RecurrenceRule
```

The interval should have a value greater than 0 and specifies how often the pattern repeats. For example, an interval of 1 specifies that the rule should repeat every week and a value of 3 specifies that the rule should repeat every third week.

The setPositions filters which recurrences to include in the rule's frequency. For example, a yearly recurrence rule that has a daysOfTheWeek value that specifies Monday through Friday and setPositions contain 2 and -1, occurs only on the second weekday and last weekday of every year.

#### Parameters

**`interval` `number`**

Interval at which to repeat the rule.

**`daysOfTheWeek` `[number]`**

Days of the week to repeat the rule. Values range from 1 to 7, with Sunday being 1.

**`setPositions` `[number]`**

Filters which recurrences to include in the rule's frequency.

**`endDate` `Date`**

Date at which the recurrence rule should end.

#### Return value

**`RecurrenceRule`**

Constructed recurrence rule.

<span id="complexweeklyoccurrencecount" class="api-anchor"></span>

### complexWeeklyOccurrenceCount(interval, daysOfTheWeek, setPositions, occurrenceCount)

Constructs a complex weekly recurrence rule with an occurrence count.

```typescript
static complexWeeklyOccurrenceCount(interval: number, daysOfTheWeek: [number], setPositions: [number], occurrenceCount: number): RecurrenceRule
```

The interval should have a value greater than 0 and specifies how often the pattern repeats. For example, an interval of 1 specifies that the rule should repeat every week and a value of 3 specifies that the rule should repeat every third week.

The setPositions filters which recurrences to include in the rule's frequency. For example, a yearly recurrence rule that has a daysOfTheWeek value that specifies Monday through Friday and setPositions contain 2 and -1, occurs only on the second weekday and last weekday of every year.

#### Parameters

**`interval` `number`**

Interval at which to repeat the rule.

**`daysOfTheWeek` `[number]`**

Days of the week to repeat the rule. Values range from 1 to 7, with Sunday being 1.

**`setPositions` `[number]`**

Filters which recurrences to include in the rule's frequency.

**`occurrenceCount` `number`**

Number of times the rule should repeat before it ends.

#### Return value

**`RecurrenceRule`**

Constructed recurrence rule.

<span id="complexyearly" class="api-anchor"></span>

### complexYearly(interval, daysOfTheWeek, monthsOfTheYear, weeksOfTheYear, daysOfTheYear, setPositions)

Constructs a complex yearly recurrence rule.

```typescript
static complexYearly(interval: number, daysOfTheWeek: [number], monthsOfTheYear: [number], weeksOfTheYear: [number], daysOfTheYear: [number], setPositions: [number]): RecurrenceRule
```

The interval should have a value greater than 0 and specifies how often the pattern repeats. For example, an interval of 1 specifies that the rule should repeat every year and a value of 3 specifies that the rule should repeat every third year.

The setPositions filters which recurrences to include in the rule's frequency. For example, a yearly recurrence rule that has a daysOfTheWeek value that specifies Monday through Friday and setPositions contain 2 and -1, occurs only on the second weekday and last weekday of every year.

#### Parameters

**`interval` `number`**

Interval at which to repeat the rule.

**`daysOfTheWeek` `[number]`**

Days of the week to repeat the rule. Values range from 1 to 7, with Sunday being 1.

**`monthsOfTheYear` `[number]`**

The months of the year to repeat the rule. Values range from 1 to 12.

**`weeksOfTheYear` `[number]`**

The weeks of the year to repeat the rule. Values range from 1 to 53 and -1 to -53.

**`daysOfTheYear` `[number]`**

The days of the year to repeat the rule. Values range from 1 to 366 and -1 to -366.

**`setPositions` `[number]`**

Filters which recurrences to include in the rule's frequency.

#### Return value

**`RecurrenceRule`**

Constructed recurrence rule.

<span id="complexyearlyenddate" class="api-anchor"></span>

### complexYearlyEndDate(interval, daysOfTheWeek, monthsOfTheYear, weeksOfTheYear, daysOfTheYear, setPositions, endDate)

Constructs a complex yearly recurrence rule with an end date.

```typescript
static complexYearlyEndDate(interval: number, daysOfTheWeek: [number], monthsOfTheYear: [number], weeksOfTheYear: [number], daysOfTheYear: [number], setPositions: [number], endDate: Date): RecurrenceRule
```

The interval should have a value greater than 0 and specifies how often the pattern repeats. For example, an interval of 1 specifies that the rule should repeat every year and a value of 3 specifies that the rule should repeat every third week.

The setPositions filters which recurrences to include in the rule's frequency. For example, a yearly recurrence rule that has a daysOfTheWeek value that specifies Monday through Friday and setPositions contain 2 and -1, occurs only on the second weekday and last weekday of every year.

#### Parameters

**`interval` `number`**

Interval at which to repeat the rule.

**`daysOfTheWeek` `[number]`**

Days of the week to repeat the rule. Values range from 1 to 7, with Sunday being 1.

**`monthsOfTheYear` `[number]`**

The months of the year to repeat the rule. Values range from 1 to 12.

**`weeksOfTheYear` `[number]`**

The weeks of the year to repeat the rule. Values range from 1 to 53 and -1 to -53.

**`daysOfTheYear` `[number]`**

The days of the year to repeat the rule. Values range from 1 to 366 and -1 to -366.

**`setPositions` `[number]`**

Filters which recurrences to include in the rule's frequency.

**`endDate` `Date`**

Date at which the recurrence rule should end.

#### Return value

**`RecurrenceRule`**

Constructed recurrence rule.

<span id="complexyearlyoccurrencecount" class="api-anchor"></span>

### complexYearlyOccurrenceCount(interval, daysOfTheWeek, monthsOfTheYear, weeksOfTheYear, daysOfTheYear, setPositions, occurrenceCount)

Constructs a complex yearly recurrence rule with an occurrence count.

```typescript
static complexYearlyOccurrenceCount(interval: number, daysOfTheWeek: [number], monthsOfTheYear: [number], weeksOfTheYear: [number], daysOfTheYear: [number], setPositions: [number], occurrenceCount: number): RecurrenceRule
```

The interval should have a value greater than 0 and specifies how often the pattern repeats. For example, an interval of 1 specifies that the rule should repeat every year and a value of 3 specifies that the rule should repeat every third year.

The setPositions filters which recurrences to include in the rule's frequency. For example, a yearly recurrence rule that has a daysOfTheWeek value that specifies Monday through Friday and setPositions contain 2 and -1, occurs only on the second weekday and last weekday of every year.

#### Parameters

**`interval` `number`**

Interval at which to repeat the rule.

**`daysOfTheWeek` `[number]`**

Days of the week to repeat the rule. Values range from 1 to 7, with Sunday being 1.

**`monthsOfTheYear` `[number]`**

The months of the year to repeat the rule. Values range from 1 to 12.

**`weeksOfTheYear` `[number]`**

The weeks of the year to repeat the rule. Values range from 1 to 53 and -1 to -53.

**`daysOfTheYear` `[number]`**

The days of the year to repeat the rule. Values range from 1 to 366 and -1 to -366.

**`setPositions` `[number]`**

Filters which recurrences to include in the rule's frequency.

**`occurrenceCount` `number`**

Number of times the rule should repeat before it ends.

#### Return value

**`RecurrenceRule`**

Constructed recurrence rule.

<span id="daily" class="api-anchor"></span>

### daily(interval)

Constructs a daily recurrence rule.

```typescript
static daily(interval: number): RecurrenceRule
```

The interval should have a value greater than 0 and specifies how often the pattern repeats. For example, an interval of 1 specifies that the rule should repeat every day and a value of 3 specifies that the rule should repeat every third day.

#### Parameters

**`interval` `number`**

Interval at which to repeat the rule.

#### Return value

**`RecurrenceRule`**

Constructed recurrence rule.

<span id="dailyenddate" class="api-anchor"></span>

### dailyEndDate(interval, endDate)

Constructs a daily recurrence rule with an end date.

```typescript
static dailyEndDate(interval: number, endDate: Date): RecurrenceRule
```

The interval should have a value greater than 0 and specifies how often the pattern repeats. For example, an interval of 1 specifies that the rule should repeat every day and a value of 3 specifies that the rule should repeat every third day.

#### Parameters

**`interval` `number`**

Interval at which to repeat the rule.

**`endDate` `Date`**

Date at which the recurrence rule should end.

#### Return value

**`RecurrenceRule`**

Constructed recurrence rule.

<span id="dailyoccurrencecount" class="api-anchor"></span>

### dailyOccurrenceCount(interval, occurrenceCount)

Constructs a daily recurrence rule with an occurrence count.

```typescript
static dailyOccurrenceCount(interval: number, occurrenceCount: number): RecurrenceRule
```

The interval should have a value greater than 0 and specifies how often the pattern repeats. For example, an interval of 1 specifies that the rule should repeat every day and a value of 3 specifies that the rule should repeat every third day.

#### Parameters

**`interval` `number`**

Interval at which to repeat the rule.

**`occurrenceCount` `number`**

Number of times the rule should repeat before it ends.

#### Return value

**`RecurrenceRule`**

Constructed recurrence rule.

<span id="monthly" class="api-anchor"></span>

### monthly(interval)

Constructs a monthly recurrence rule.

```typescript
static monthly(interval: number): RecurrenceRule
```

The interval should have a value greater than 0 and specifies how often the pattern repeats. For example, an interval of 1 specifies that the rule should repeat every month and a value of 3 specifies that the rule should repeat every third month.

#### Parameters

**`interval` `number`**

Interval at which to repeat the rule.

#### Return value

**`RecurrenceRule`**

Constructed recurrence rule.

<span id="monthlyenddate" class="api-anchor"></span>

### monthlyEndDate(interval, endDate)

Constructs a monthly recurrence rule with an end date.

```typescript
static monthlyEndDate(interval: number, endDate: Date): RecurrenceRule
```

The interval should have a value greater than 0 and specifies how often the pattern repeats. For example, an interval of 1 specifies that the rule should repeat every month and a value of 3 specifies that the rule should repeat every third month.

#### Parameters

**`interval` `number`**

Interval at which to repeat the rule.

**`endDate` `Date`**

Date at which the recurrence rule should end.

#### Return value

**`RecurrenceRule`**

Constructed recurrence rule.

<span id="monthlyoccurrencecount" class="api-anchor"></span>

### monthlyOccurrenceCount(interval, occurrenceCount)

Constructs a monthly recurrence rule with an occurrence count.

```typescript
static monthlyOccurrenceCount(interval: number, occurrenceCount: number): RecurrenceRule
```

The interval should have a value greater than 0 and specifies how often the pattern repeats. For example, an interval of 1 specifies that the rule should repeat every month and a value of 3 specifies that the rule should repeat every third month.

#### Parameters

**`interval` `number`**

Interval at which to repeat the rule.

**`occurrenceCount` `number`**

Number of times the rule should repeat before it ends.

#### Return value

**`RecurrenceRule`**

Constructed recurrence rule.

<span id="weekly" class="api-anchor"></span>

### weekly(interval)

Constructs a weekly recurrence rule.

```typescript
static weekly(interval: number): RecurrenceRule
```

The interval should have a value greater than 0 and specifies how often the pattern repeats. For example, an interval of 1 specifies that the rule should repeat every week and a value of 3 specifies that the rule should repeat every third week.

#### Parameters

**`interval` `number`**

Interval at which to repeat the rule.

#### Return value

**`RecurrenceRule`**

Constructed recurrence rule.

<span id="weeklyenddate" class="api-anchor"></span>

### weeklyEndDate(interval, endDate)

Constructs a weekly recurrence rule with an end date.

```typescript
static weeklyEndDate(interval: number, endDate: Date): RecurrenceRule
```

The interval should have a value greater than 0 and specifies how often the pattern repeats. For example, an interval of 1 specifies that the rule should repeat every week and a value of 3 specifies that the rule should repeat every third week.

#### Parameters

**`interval` `number`**

Interval at which to repeat the rule.

**`endDate` `Date`**

Date at which the recurrence rule should end.

#### Return value

**`RecurrenceRule`**

Constructed recurrence rule.

<span id="weeklyoccurrencecount" class="api-anchor"></span>

### weeklyOccurrenceCount(interval, occurrenceCount)

Constructs a weekly recurrence rule with an occurrence count.

```typescript
static weeklyOccurrenceCount(interval: number, occurrenceCount: number): RecurrenceRule
```

The interval should have a value greater than 0 and specifies how often the pattern repeats. For example, an interval of 1 specifies that the rule should repeat every week and a value of 3 specifies that the rule should repeat every third week.

#### Parameters

**`interval` `number`**

Interval at which to repeat the rule.

**`occurrenceCount` `number`**

Number of times the rule should repeat before it ends.

#### Return value

**`RecurrenceRule`**

Constructed recurrence rule.

<span id="yearly" class="api-anchor"></span>

### yearly(interval)

Constructs a yearly recurrence rule.

```typescript
static yearly(interval: number): RecurrenceRule
```

The interval should have a value greater than 0 and specifies how often the pattern repeats. For example, an interval of 1 specifies that the rule should repeat every year and a value of 3 specifies that the rule should repeat every third year.

#### Parameters

**`interval` `number`**

Interval at which to repeat the rule.

#### Return value

**`RecurrenceRule`**

Constructed recurrence rule.

<span id="yearlyenddate" class="api-anchor"></span>

### yearlyEndDate(interval, endDate)

Constructs a yearly recurrence rule with an end date.

```typescript
static yearlyEndDate(interval: number, endDate: Date): RecurrenceRule
```

The interval should have a value greater than 0 and specifies how often the pattern repeats. For example, an interval of 1 specifies that the rule should repeat every year and a value of 3 specifies that the rule should repeat every third year.

#### Parameters

**`interval` `number`**

Interval at which to repeat the rule.

**`endDate` `Date`**

Date at which the recurrence rule should end.

#### Return value

**`RecurrenceRule`**

Constructed recurrence rule.

<span id="yearlyoccurrencecount" class="api-anchor"></span>

### yearlyOccurrenceCount(interval, occurrenceCount)

Constructs a yearly recurrence rule with an occurrence count.

```typescript
static yearlyOccurrenceCount(interval: number, occurrenceCount: number): RecurrenceRule
```

The interval should have a value greater than 0 and specifies how often the pattern repeats. For example, an interval of 1 specifies that the rule should repeat every year and a value of 3 specifies that the rule should repeat every third year.

#### Parameters

**`interval` `number`**

Interval at which to repeat the rule.

**`occurrenceCount` `number`**

Number of times the rule should repeat before it ends.

#### Return value

**`RecurrenceRule`**

Constructed recurrence rule.