Class EventRecurrence

EventRecurrence

代表活動系列的重複週期設定。

方法

方法傳回類型簡短說明
addDailyExclusion()RecurrenceRule新增每日排除發生的規則。
addDailyRule()RecurrenceRule加入讓事件每天重複執行的規則。
addDate(date)EventRecurrence加入讓事件在特定日期重複執行的規則。
addDateExclusion(date)EventRecurrence新增用於排除特定日期出現情況的規則。
addMonthlyExclusion()RecurrenceRule新增每月排除重複次數的規則。
addMonthlyRule()RecurrenceRule加入讓事件每月重複執行的規則。
addWeeklyExclusion()RecurrenceRule新增每週排除發生次數的規則。
addWeeklyRule()RecurrenceRule新增規則,讓事件每週重複執行。
addYearlyExclusion()RecurrenceRule新增每年排除發生次數的規則。
addYearlyRule()RecurrenceRule加入讓活動每年重複執行的規則。
setTimeZone(timeZone)EventRecurrence設定這個週期的時區。

內容詳盡的說明文件

addDailyExclusion()

新增每日排除發生的規則。

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

回攻員

RecurrenceRule:新的 RecurrenceRule

授權

使用這個方法的指令碼必須取得下列一或多個範圍 (或相關的 REST API) 的適當範圍授權:

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

addDailyRule()

加入讓事件每天重複執行的規則。

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

回攻員

RecurrenceRule:新的 RecurrenceRule

授權

使用這個方法的指令碼必須取得下列一或多個範圍 (或相關的 REST API) 的適當範圍授權:

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

addDate(date)

加入讓事件在特定日期重複執行的規則。

參數

名稱類型說明
dateDate

回攻員

EventRecurrence — 這個 EventRecurrence 用於鏈結

授權

使用這個方法的指令碼必須取得下列一或多個範圍 (或相關的 REST API) 的適當範圍授權:

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

addDateExclusion(date)

新增用於排除特定日期出現情況的規則。

參數

名稱類型說明
dateDate

回攻員

EventRecurrence — 這個 EventRecurrence 用於鏈結

授權

使用這個方法的指令碼必須取得下列一或多個範圍 (或相關的 REST API) 的適當範圍授權:

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

addMonthlyExclusion()

新增每月排除重複次數的規則。

根據預設,排除規則會在系列中第一個事件的當月同一天套用,但呼叫 RecurrenceRule.onlyOnMonthDay(day)RecurrenceRule.onlyOnMonthDays(days) 則可變更。

回攻員

RecurrenceRule:新的 RecurrenceRule

授權

使用這個方法的指令碼必須取得下列一或多個範圍 (或相關的 REST API) 的適當範圍授權:

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

addMonthlyRule()

新增每月重複執行事件的規則。

根據預設,該事件會在系列中第一個事件的同一天重複發生,但呼叫 RecurrenceRule.onlyOnMonthDay(day)RecurrenceRule.onlyOnMonthDays(days) 可變更這個值。

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

回攻員

RecurrenceRule:新的 RecurrenceRule

授權

使用這個方法的指令碼必須取得下列一或多個範圍 (或相關的 REST API) 的適當範圍授權:

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

addWeeklyExclusion()

新增每週排除發生次數的規則。

根據預設,排除會在與系列中第一個事件當週的同一天套用,但呼叫 RecurrenceRule.onlyOnWeekday(day)RecurrenceRule.onlyOnWeekdays(days) 可以變更這項設定。

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

回攻員

RecurrenceRule:新的 RecurrenceRule

授權

使用這個方法的指令碼必須取得下列一或多個範圍 (或相關的 REST API) 的適當範圍授權:

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

addWeeklyRule()

新增讓事件每週重複執行的規則。

根據預設,該活動會在系列中第一個活動當週的同一天重複發生,但呼叫 RecurrenceRule.onlyOnWeekday(day)RecurrenceRule.onlyOnWeekdays(days) 可變更這項設定。

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

回攻員

RecurrenceRule:新的 RecurrenceRule

授權

使用這個方法的指令碼必須取得下列一或多個範圍 (或相關的 REST API) 的適當範圍授權:

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

addYearlyExclusion()

新增每年排除發生次數的規則。

根據預設,排除會在一年中與系列中第一個事件的同一天套用,但呼叫 RecurrenceRule.onlyOnYearDay(day)RecurrenceRule.onlyOnYearDays(days) 可變更這項設定。

回攻員

RecurrenceRule:新的 RecurrenceRule

授權

使用這個方法的指令碼必須取得下列一或多個範圍 (或相關的 REST API) 的適當範圍授權:

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

addYearlyRule()

加入讓事件每年重複執行的規則。

根據預設,該活動會在系列中第一個活動的同一天重複發生的,但呼叫 RecurrenceRule.onlyOnYearDay(day)RecurrenceRule.onlyOnYearDays(days) 可變更這項設定。

回攻員

RecurrenceRule:新的 RecurrenceRule

授權

使用這個方法的指令碼必須取得下列一或多個範圍 (或相關的 REST API) 的適當範圍授權:

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

setTimeZone(timeZone)

設定這個週期的時區。這會影響重複發生活動的日期和時間,以及活動是否會隨著日光節約時間而變動。預設為日曆的時區。

參數

名稱類型說明
timeZoneString以「長」格式指定的時區 (例如Joda.org 列出的「America/New_York」)。

回攻員

EventRecurrence — 這個 EventRecurrence 用於鏈結

授權

使用這個方法的指令碼必須取得下列一或多個範圍 (或相關的 REST API) 的適當範圍授權:

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