Class EventRecurrence

  • EventRecurrence represents the recurrence settings for an event series.

  • You can add rules to specify daily, weekly, monthly, or yearly recurrences or exclusions for events.

  • Specific dates can be added for event recurrences or excluded from an event series.

  • The time zone for the recurrence can be set, affecting when events recur.

EventRecurrence

Represents the recurrence settings for an event series.

Methods

MethodReturn typeBrief description
addDailyExclusion()RecurrenceRuleAdds a rule that excludes occurrences on a daily basis.
addDailyRule()RecurrenceRuleAdds a rule that causes the event to recur on a daily basis.
addDate(date)EventRecurrenceAdds a rule that causes the event to recur on a specific date.
addDateExclusion(date)EventRecurrenceAdds a rule that excludes an occurrence for a specific date.
addMonthlyExclusion()RecurrenceRuleAdds a rule that excludes occurrences on a monthly basis.
addMonthlyRule()RecurrenceRuleAdds a rule that causes the event to recur on a monthly basis.
addWeeklyExclusion()RecurrenceRuleAdds a rule that excludes occurrences on a weekly basis.
addWeeklyRule()RecurrenceRuleAdds a rule that causes the event to recur on a weekly basis.
addYearlyExclusion()RecurrenceRuleAdds a rule that excludes occurrences on a yearly basis.
addYearlyRule()RecurrenceRuleAdds a rule that causes the event to recur on a yearly basis.
setTimeZone(timeZone)EventRecurrenceSets the time zone for this recurrence.

Detailed documentation

addDailyExclusion()

Adds a rule that excludes occurrences on a daily basis.

// Creates a rule that recurs every week after the first 30 days.constrecurrence=CalendarApp.newRecurrence().addWeeklyRule().addDailyExclusion().times(30);

Return

RecurrenceRule — the new RecurrenceRule

Authorization

Scripts that use this method require authorization with one or more of the followingscopes or appropriate scopes from therelated REST API:

  • https://www.googleapis.com/auth/calendar
  • https://www.google.com/calendar/feeds

addDailyRule()

Adds a rule that causes the event to recur on a daily basis.

// Creates a rule that recurs every day for ten days.constrecurrence=CalendarApp.newRecurrence().addDailyRule().times(10);

Return

RecurrenceRule — the new RecurrenceRule

Authorization

Scripts that use this method require authorization with one or more of the followingscopes or appropriate scopes from therelated REST API:

  • https://www.googleapis.com/auth/calendar
  • https://www.google.com/calendar/feeds

addDate(date)

Adds a rule that causes the event to recur on a specific date.

Parameters

NameTypeDescription
dateDate

Return

EventRecurrence — this EventRecurrence for chaining

Authorization

Scripts that use this method require authorization with one or more of the followingscopes or appropriate scopes from therelated REST API:

  • https://www.googleapis.com/auth/calendar
  • https://www.google.com/calendar/feeds

addDateExclusion(date)

Adds a rule that excludes an occurrence for a specific date.

Parameters

NameTypeDescription
dateDate

Return

EventRecurrence — this EventRecurrence for chaining

Authorization

Scripts that use this method require authorization with one or more of the followingscopes or appropriate scopes from therelated REST API:

  • https://www.googleapis.com/auth/calendar
  • https://www.google.com/calendar/feeds

addMonthlyExclusion()

Adds a rule that excludes occurrences on a monthly basis.

By default the exclusion is applied on the same day of the month as the first event in theseries, but this can be altered by callingRecurrenceRule.onlyOnMonthDay(day) orRecurrenceRule.onlyOnMonthDays(days).

Return

RecurrenceRule — the new RecurrenceRule

Authorization

Scripts that use this method require authorization with one or more of the followingscopes or appropriate scopes from therelated REST API:

  • https://www.googleapis.com/auth/calendar
  • https://www.google.com/calendar/feeds

addMonthlyRule()

Adds a rule that causes the event to recur on a monthly basis.

By default the event recurs on the same day of the month as the first event in the series,but this can be altered by callingRecurrenceRule.onlyOnMonthDay(day) orRecurrenceRule.onlyOnMonthDays(days).

// Creates a rule that recurs every month for three months.constrecurrence=CalendarApp.newRecurrence().addMonthlyRule().times(4);

Return

RecurrenceRule — the new RecurrenceRule

Authorization

Scripts that use this method require authorization with one or more of the followingscopes or appropriate scopes from therelated REST API:

  • https://www.googleapis.com/auth/calendar
  • https://www.google.com/calendar/feeds

addWeeklyExclusion()

Adds a rule that excludes occurrences on a weekly basis.

By default the exclusion is applied on the same day of the week as the first event in theseries, but this can be altered by callingRecurrenceRule.onlyOnWeekday(day) orRecurrenceRule.onlyOnWeekdays(days).

// Creates a rule that recurs every day except the first four Wednesdays.constrecurrence=CalendarApp.newRecurrence().addDailyRule().addWeeklyExclusion().onlyOnWeekday(CalendarApp.Weekday.WEDNESDAY).times(4);

Return

RecurrenceRule — the new RecurrenceRule

Authorization

Scripts that use this method require authorization with one or more of the followingscopes or appropriate scopes from therelated REST API:

  • https://www.googleapis.com/auth/calendar
  • https://www.google.com/calendar/feeds

addWeeklyRule()

Adds a rule that causes the event to recur on a weekly basis.

By default the event recurs on the same day of the week as the first event in the series,but this can be altered by callingRecurrenceRule.onlyOnWeekday(day) orRecurrenceRule.onlyOnWeekdays(days).

// Creates a rule that recurs every week for ten weeks.constrecurrence=CalendarApp.newRecurrence().addWeeklyRule().times(10);

Return

RecurrenceRule — the new RecurrenceRule

Authorization

Scripts that use this method require authorization with one or more of the followingscopes or appropriate scopes from therelated REST API:

  • https://www.googleapis.com/auth/calendar
  • https://www.google.com/calendar/feeds

addYearlyExclusion()

Adds a rule that excludes occurrences on a yearly basis.

By default the exclusion is applied on the same day of the year as the first event in theseries, but this can be altered by callingRecurrenceRule.onlyOnYearDay(day) orRecurrenceRule.onlyOnYearDays(days).

Return

RecurrenceRule — the new RecurrenceRule

Authorization

Scripts that use this method require authorization with one or more of the followingscopes or appropriate scopes from therelated REST API:

  • https://www.googleapis.com/auth/calendar
  • https://www.google.com/calendar/feeds

addYearlyRule()

Adds a rule that causes the event to recur on a yearly basis.

By default the event recurs on the same day of the year as the first event in the series,but this can be altered by callingRecurrenceRule.onlyOnYearDay(day) orRecurrenceRule.onlyOnYearDays(days).

Return

RecurrenceRule — the new RecurrenceRule

Authorization

Scripts that use this method require authorization with one or more of the followingscopes or appropriate scopes from therelated REST API:

  • https://www.googleapis.com/auth/calendar
  • https://www.google.com/calendar/feeds

setTimeZone(timeZone)

Sets the time zone for this recurrence. This affects the date and time that events recur on,and whether the event shifts with daylight savings time. Defaults to the calendar's time zone.

Parameters

NameTypeDescription
timeZoneStringthe time zone, specified in "long" format (e.g., 'America/New_York', as listed byJoda.org)

Return

EventRecurrence — this EventRecurrence for chaining

Authorization

Scripts that use this method require authorization with one or more of the followingscopes or appropriate scopes from therelated REST API:

  • https://www.googleapis.com/auth/calendar
  • https://www.google.com/calendar/feeds

Except as otherwise noted, the content of this page is licensed under theCreative Commons Attribution 4.0 License, and code samples are licensed under theApache 2.0 License. For details, see theGoogle Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2025-12-11 UTC.