Class CalendarEventSeries

カレンダーイベントシリーズ

一連のイベント(定期的な予定)を表します。

メソッド

メソッド戻り値の型概要
addEmailReminder(minutesBefore)CalendarEventSeriesイベントに新しいメール通知を追加します。
addGuest(email)CalendarEventSeries予定にゲストを追加します。
addPopupReminder(minutesBefore)CalendarEventSeriesイベントに新しいポップアップ通知を追加します。
addSmsReminder(minutesBefore)CalendarEventSeriesイベントに新しい SMS リマインダーを追加します。
anyoneCanAddSelf()Booleanユーザーがカレンダーの予定に自分自身をゲストとして追加できるかどうかを決定します。
deleteEventSeries()voidイベント シリーズを削除します。
deleteTag(key)CalendarEventSeriesイベントから Key-Value タグを削除します。
getAllTagKeys()String[]イベントに設定されているタグのすべてのキーを取得します。
getColor()Stringカレンダーの予定の色を返します。
getCreators()String[]イベントの作成者を取得します。
getDateCreated()Dateイベントの作成日を取得します。
getDescription()Stringイベントの説明を取得します。
getEmailReminders()Integer[]イベントのすべてのメール通知の分単位の値を取得します。
getEventType()EventTypeこのイベントの EventType を取得します。
getGuestByEmail(email)EventGuestメールアドレスでゲストを取得します。
getGuestList()EventGuest[]予定のゲスト(予定のオーナーは含まない)を取得します。
getGuestList(includeOwner)EventGuest[]イベントのゲスト(イベント オーナーを含む場合もあります)を取得します。
getId()Stringイベントの一意の iCalUID を取得します。
getLastUpdated()Date予定が最後に更新された日付を取得します。
getLocation()Stringイベントの場所を取得します。
getMyStatus()GuestStatus有効なユーザーのイベント ステータス(参加中、招待済みなど)を取得します。
getOriginalCalendarId()Stringこの予定が最初に作成されたカレンダーの ID を取得します。
getPopupReminders()Integer[]イベントのすべてのポップアップ リマインダーの分値を取得します。
getSmsReminders()Integer[]イベントのすべての SMS リマインダーの分値を取得します。
getTag(key)Stringイベントのタグ値を取得します。
getTitle()Stringイベントのタイトルを取得します。
getTransparency()EventTransparencyイベントの透明度を取得します。
getVisibility()Visibilityイベントの公開設定を取得します。
guestsCanInviteOthers()Booleanゲストが他のゲストを招待できるかどうかを判断します。
guestsCanModify()Booleanゲストが予定を変更できるかどうかを指定します。
guestsCanSeeGuests()Booleanゲストが他のゲストを確認できるかどうかを判断します。
isOwnedByMe()Boolean自分がイベントのオーナーかどうかを判断します。
removeAllReminders()CalendarEventSeries予定からすべてのリマインダーを削除します。
removeGuest(email)CalendarEventSeries予定からゲストを削除します。
resetRemindersToDefault()CalendarEventSeriesカレンダーのデフォルト設定を使用してリマインダーをリセットします。
setAnyoneCanAddSelf(anyoneCanAddSelf)CalendarEventSeriesゲスト以外のユーザーが予定に自分自身を追加できるかどうかを設定します。
setColor(color)CalendarEventSeriesカレンダーの予定の色を設定します。
setDescription(description)CalendarEventSeriesイベントの説明を設定します。
setGuestsCanInviteOthers(guestsCanInviteOthers)CalendarEventSeriesゲストが他のゲストを招待できるかどうかを設定します。
setGuestsCanModify(guestsCanModify)CalendarEventSeriesゲストが予定を変更できるかどうかを設定します。
setGuestsCanSeeGuests(guestsCanSeeGuests)CalendarEventSeriesゲストが他のゲストを確認できるかどうかを設定します。
setLocation(location)CalendarEventSeriesイベントの場所を設定します。
setMyStatus(status)CalendarEventSeries有効なユーザーのイベント ステータス(参加、招待など)を設定します。
setRecurrence(recurrence, startDate)CalendarEventSeries終日の一連の予定の繰り返しルールを設定します。
setRecurrence(recurrence, startTime, endTime)CalendarEventSeriesこのイベントシリーズの繰り返しルールを設定します。
setTag(key, value)CalendarEventSeriesカスタム メタデータを保存するために、イベントに Key-Value タグを設定します。
setTitle(title)CalendarEventSeriesイベントのタイトルを設定します。
setTransparency(transparency)CalendarEventSeriesイベントの透明度を設定します。
setVisibility(visibility)CalendarEventSeriesイベントの公開設定を設定します。

詳細なドキュメント

addEmailReminder(minutesBefore)

イベントに新しいメール通知を追加します。リマインダーは、イベントの 5 分以上 4 週間(4,0320 分)以内に設定する必要があります。

// Gets an event by its ID. For an event series, use getEventSeriesById(iCalId) // instead. // TODO(developer): Replace the string with the event ID that you want to get. const event = CalendarApp.getEventById('abc123456');  // Adds an email notification for 15 minutes before the event. event.addEmailReminder(15);

パラメータ

名前説明
minutesBeforeInteger予定の開始前の分数

戻る

CalendarEventSeries - チェーン用の this CalendarEventSeries

例外

Error - イベントに 5 つを超えるリマインダーがある場合、または時刻が有効な範囲外の場合

承認

このメソッドを使用するスクリプトには、次のスコープの 1 つ以上、または関連する REST API の適切なスコープによる承認が必要です。

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

addGuest(email)

予定にゲストを追加します。

// Example 1: Add a guest to one event function addAttendeeToEvent() {   // Replace the below values with your own   const attendeeEmail =       '[email protected]';  // Email address of the person you need to add   const calendarId =       '[email protected]';  // ID of calendar containing   // event   const eventId = '123abc';  // ID of event instance    const calendar = CalendarApp.getCalendarById(calendarId);   if (calendar === null) {     // Calendar not found     console.log('Calendar not found', calendarId);     return;   }   const event = calendar.getEventById(eventId);   if (event === null) {     // Event not found     console.log('Event not found', eventId);     return;   }   event.addGuest(attendeeEmail); }  // Example 2: Add a guest to all events on a calendar within a specified // timeframe function addAttendeeToAllEvents() {   // Replace the following values with your own   const attendeeEmail =       '[email protected]';  // Email address of the person you need to add   const calendarId =       '[email protected]';  // ID of calendar with the   // events   const startDate =       new Date('YYYY-MM-DD');  // The first date to add the guest to the events   const endDate =       new Date('YYYY-MM-DD');  // The last date to add the guest to the events    const calendar = CalendarApp.getCalendarById(calendarId);   if (calendar === null) {     // Calendar not found     console.log('Calendar not found', calendarId);     return;   }   // Get the events within the specified timeframe   const calEvents = calendar.getEvents(startDate, endDate);   console.log(calEvents.length);  // Checks how many events are found   // Loop through all events and add the attendee to each of them   for (let i = 0; i < calEvents.length; i++) {     const event = calEvents[i];     event.addGuest(attendeeEmail);   } }

パラメータ

名前説明
emailStringゲストのメールアドレス。

戻る

CalendarEventSeries - チェーン用の CalendarEventSeries

承認

このメソッドを使用するスクリプトには、次のスコープの 1 つ以上、または関連する REST API の適切なスコープによる承認が必要です。

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

addPopupReminder(minutesBefore)

イベントに新しいポップアップ通知を追加します。通知は、イベントの 5 分以上前、4 週間(4,0320 分)以内に行う必要があります。

// Gets an event by its ID. For an event series, use getEventSeriesById(iCalId) // instead. // TODO(developer): Replace the string with the event ID that you want to get. const event = CalendarApp.getEventById('abc123456');  // Adds a pop-up notification for 15 minutes before the event. event.addPopupReminder(15);

パラメータ

名前説明
minutesBeforeInteger予定の開始前の分数

戻る

CalendarEventSeries - チェーン用の this CalendarEventSeries

承認

このメソッドを使用するスクリプトには、次のスコープの 1 つ以上、または関連する REST API の適切なスコープによる承認が必要です。

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

addSmsReminder(minutesBefore)

イベントに新しい SMS リマインダーを追加します。リマインダーは、イベントの 5 分以上 4 週間(4,0320 分)以内に設定する必要があります。

パラメータ

名前説明
minutesBeforeInteger予定の開始前の分数

戻る

CalendarEventSeries - チェーン用の this CalendarEventSeries

例外

Error - 予定にリマインダーが 5 つ以上ある場合、または時刻が有効な範囲外の場合

承認

このメソッドを使用するスクリプトには、次のスコープの 1 つ以上、または関連する REST API の適切なスコープによる承認が必要です。

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

anyoneCanAddSelf()

ユーザーがカレンダーの予定に自分自身をゲストとして追加できるかどうかを決定します。

// Gets an event by its ID. For an event series, use getEventSeriesById(iCalId) // instead. // TODO(developer): Replace the string with the event ID that you want to get. const event = CalendarApp.getEventById('abc123456');  // Determines whether people can add themselves as guests to the event and logs // it. console.log(event.anyoneCanAddSelf());

戻る

Boolean - ゲスト以外のユーザーが予定に自分自身を追加できる場合は true、できない場合は false

承認

このメソッドを使用するスクリプトには、次のスコープの 1 つ以上、または関連する REST API の適切なスコープによる承認が必要です。

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

deleteEventSeries()

イベント シリーズを削除します。

承認

このメソッドを使用するスクリプトには、次のスコープの 1 つ以上、または関連する REST API の適切なスコープによる承認が必要です。

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

deleteTag(key)

イベントから Key-Value タグを削除します。

パラメータ

名前説明
keyStringタグキー

戻る

CalendarEventSeries - チェーン用の this CalendarEventSeries

承認

このメソッドを使用するスクリプトには、次のスコープの 1 つ以上、または関連する REST API の適切なスコープによる承認が必要です。

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

getAllTagKeys()

イベントに設定されているタグのすべてのキーを取得します。

戻る

String[] - 文字列キーの配列

承認

このメソッドを使用するスクリプトには、次のスコープの 1 つ以上、または関連する REST API の適切なスコープによる承認が必要です。

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

getColor()

カレンダーの予定の色を返します。

// Gets an event by its ID. For an event series, use getEventSeriesById(iCalId) // instead. // TODO(developer): Replace the string with the event ID that you want to get. const event = CalendarApp.getEventById('abc123456');  // Gets the color of the calendar event and logs it. const eventColor = event.getColor(); console.log(eventColor);

戻る

String - イベントの色の文字列表現(CalendarApp.EventColor の値のインデックス(1 ~ 11))。

承認

このメソッドを使用するスクリプトには、次のスコープの 1 つ以上、または関連する REST API の適切なスコープによる承認が必要です。

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

getCreators()

イベントの作成者を取得します。

// Gets an event by its ID. For an event series, use getEventSeriesById(iCalId) // instead. // TODO(developer): Replace the string with the event ID that you want to get. const event = CalendarApp.getEventById('abc123456');  // Gets a list of the creators of the event and logs it. console.log(event.getCreators());

戻る

String[] - イベントの作成者のメールアドレス

承認

このメソッドを使用するスクリプトには、次のスコープの 1 つ以上、または関連する REST API の適切なスコープによる承認が必要です。

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

getDateCreated()

イベントが作成された日付を取得します。カレンダーにアクセスできる必要があります。

// Opens the calendar by using its ID. // To get the user's default calendar use CalendarApp.getDefault() instead. // TODO(developer): Replace the calendar ID with your own. const calendar = CalendarApp.getCalendarById(     '[email protected]', );  // Gets the first event from the calendar for February 1st, 2023 that takes // place between 8:10 AM and 4:25 PM. For an event series, use // calendar.getEventSeriesById('[email protected]'); and replace the series // ID with your own. const event = calendar.getEvents(     new Date('Feb 01, 2023 08:10:00'),     new Date('Feb 01, 2023 16:25:00'),     )[0];  if (event) {   // If an event exists within the given time frame, gets the date that the   // event was created and logs it.   const eventCreated = event.getDateCreated();   console.log(eventCreated); } else {   // If no event exists within the given time frame, logs that information to   // the console.   console.log('No events exist for the specified range'); }

戻る

Date - 作成日

承認

このメソッドを使用するスクリプトには、次のスコープの 1 つ以上、または関連する REST API の適切なスコープによる承認が必要です。

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

getDescription()

イベントの説明を取得します。カレンダーに対する編集権限が必要です。

// Opens the calendar by its ID. // To get the user's default calendar use CalendarApp.getDefault() instead. // TODO(developer): Replace the ID with your own. const calendar = CalendarApp.getCalendarById(     '[email protected]', );  // Gets the first event from the calendar for February 4th, 2023 that takes // place between 4:00 PM and 5:00 PM. For an event series, use // calendar.getEventSeriesById('[email protected]'); and replace the series // ID with your own. const event = calendar.getEvents(     new Date('Feb 04, 2023 16:00:00'),     new Date('Feb 04, 2023 17:00:00'),     )[0];  if (event) {   // If an event exists within the given time frame, sets the description of the   // event.   event.setDescription('Important meeting');    // Gets the description of the event and logs it.   const description = event.getDescription();   console.log(description); } else {   // If no event exists within the given time frame, logs that information to   // the console.   console.log('No events exist for the specified range'); }

戻る

String - 説明

承認

このメソッドを使用するスクリプトには、次のスコープの 1 つ以上、または関連する REST API の適切なスコープによる承認が必要です。

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

getEmailReminders()

イベントのすべてのメール通知の分単位の値を取得します。カレンダーの編集権限が必要です。

// Opens the calendar by its ID. // TODO(developer): Replace the ID with your own. const calendar = CalendarApp.getCalendarById(     '[email protected]', );  // Gets the first event from the calendar for February 4th, 2023 that takes // place between 5:00 PM and 6:00 PM. For an event series, use // calendar.getEventSeriesById('[email protected]'); and replace the series // ID with your own. const event = calendar.getEvents(     new Date('Feb 04, 2023 15:00:00'),     new Date('Feb 04, 2023 18:00:00'),     )[0];  if (event) {   // If an event exists within the given time frame, adds email reminders for   // the user to be sent at 4 and 7 minutes before the event.   event.addEmailReminder(4);   event.addEmailReminder(7);    // Gets the minute values for all email reminders that are set up for the user   // for this event and logs it.   const emailReminder = event.getEmailReminders();   console.log(emailReminder); } else {   // If no event exists within the given time frame, logs that information to   // the console.   console.log('No events exist for the specified range'); }

戻る

Integer[] - 各値がリマインダーがトリガーされるイベントの分数に対応する配列

承認

このメソッドを使用するスクリプトには、次のスコープの 1 つ以上、または関連する REST API の適切なスコープによる承認が必要です。

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

getEventType()

このイベントの EventType を取得します。

// Opens the default calendar and logs all out-of-office events for the current day. const calendar = CalendarApp.getDefaultCalendar(); const events = calendar.getEventsForDay(new Date()); console.log(events.filter(e => e.getEventType() === CalendarApp.EventType.OUT_OF_OFFICE));

戻る

EventType - イベントタイプ。

承認

このメソッドを使用するスクリプトには、次のスコープの 1 つ以上、または関連する REST API の適切なスコープによる承認が必要です。

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

getGuestByEmail(email)

メールアドレスでゲストを取得します。

// Opens the calendar by its ID. You must have edit access to the calendar. // TODO(developer): Replace the ID with your own. const calendar = CalendarApp.getCalendarById(     '[email protected]', );  // Gets the first event from the calendar for February 25th, 2023 that takes // place between 5:00 PM and 5:25 PM. For an event series, use // calendar.getEventSeriesById('[email protected]'); and replace the series // ID with your own. const event = calendar.getEvents(     new Date('Feb 25,2023 17:00:00'),     new Date('Feb 25,2023 17:25:00'),     )[0];  // Gets a guest by email address. const guestEmailId = event.getGuestByEmail('[email protected]');  // If the email address corresponds to an event guest, logs the email address. if (guestEmailId) {   console.log(guestEmailId.getEmail()); }

パラメータ

名前説明
emailStringゲストの住所

戻る

EventGuest - ゲスト。メールアドレスがゲストに対応していない場合は null

承認

このメソッドを使用するスクリプトには、次のスコープの 1 つ以上、または関連する REST API の適切なスコープによる承認が必要です。

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

getGuestList()

イベントのゲストを取得します(イベント所有者は含まれません)。

// Opens the calendar by its ID. You must have edit access to the calendar. // TODO(developer): Replace the ID with your own. const calendar = CalendarApp.getCalendarById(     '[email protected]', );  // Gets the first event from the calendar for February 25th, 2023 that takes // place between 5:00 PM and 5:25 PM. For an event series, use // calendar.getEventSeriesById('[email protected]'); and replace the series // ID with your own. const event = calendar.getEvents(     new Date('Feb 25,2023 17:00:00'),     new Date('Feb 25,2023 17:25:00'),     )[0];  // Adds two guests to the event by using their email addresses. event.addGuest('[email protected]'); event.addGuest('[email protected]');  // Gets the guests list for the event. const guestList = event.getGuestList();  // Loops through the list to get all the guests and logs their email addresses. for (const guest of guestList) {   console.log(guest.getEmail()); }

戻る

EventGuest[] - ゲストの配列

承認

このメソッドを使用するスクリプトには、次のスコープの 1 つ以上、または関連する REST API の適切なスコープによる承認が必要です。

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

getGuestList(includeOwner)

イベントのゲスト(イベント オーナーを含む場合もあります)を取得します。

// Opens the calendar by its ID. You must have edit access to the calendar. // TODO(developer): Replace the ID with your own. const calendar = CalendarApp.getCalendarById(     '[email protected]', );  // Gets the first event from the calendar for February 25th, 2023 that takes // place between 5:00 PM and 5:25 PM. For an event series, use // calendar.getEventSeriesById('[email protected]'); and replace the series // ID with your own. const event = calendar.getEvents(     new Date('Feb 25,2023 17:00:00'),     new Date('Feb 25,2023 17:25:00'),     )[0];  // Gets the guests list for the event, including the owner of the event. const guestList = event.getGuestList(true);  // Loops through the list to get all the guests and logs it. for (const guest of guestList) {   console.log(guest.getEmail()); }

パラメータ

名前説明
includeOwnerBoolean所有者をゲストとして含めるかどうか

戻る

EventGuest[] - ゲストの配列

承認

このメソッドを使用するスクリプトには、次のスコープの 1 つ以上、または関連する REST API の適切なスコープによる承認が必要です。

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

getId()

イベントの一意の iCalUID を取得します。Calendar v3 APICalendar アドバンスト サービスで使用される iCalUID とイベント id は同じではなく、相互に使用できません。セマンティクスの違いの一つは、定期的なイベントでは、1 つのイベントのすべての発生が異なる ids を持つ一方で、同じ iCalUID を共有することです。

// Opens the calendar by its ID. You must have edit access to the calendar. // TODO(developer): Replace the ID with your own. const calendar = CalendarApp.getCalendarById(     '[email protected]', );  // Gets the first event from the calendar for January 5th, 2023 that takes place // between 9:00 AM and 9:25 AM. // For an event series, use calendar.getEventSeriesById('[email protected]'); // and replace the series ID with your own. const event = calendar.getEvents(     new Date('Jan 05, 2023 09:00:00'),     new Date('Jan 05, 2023 09:25:00'),     )[0];  // Gets the ID of the event and logs it. console.log(event.getId());

戻る

String - イベントの iCalUID

承認

このメソッドを使用するスクリプトには、次のスコープの 1 つ以上、または関連する REST API の適切なスコープによる承認が必要です。

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

getLastUpdated()

イベントが最後に更新された日付を取得します。

// Opens the calendar by its ID. You must have view access to the calendar. // TODO(developer): Replace the ID with your own. const calendar = CalendarApp.getCalendarById(     '[email protected]', );  // Gets the first event from the calendar for February 1st, 2023 that takes // place between 4:00 PM and 5:00 PM. For an event series, use // calendar.getEventSeriesById('[email protected]'); and replace the series // ID with your own. const event = calendar.getEvents(     new Date('Feb 01, 2023 16:00:00'),     new Date('Feb 01, 2023 17:00:00'),     )[0];  // Gets the date the event was last updated and logs it. const eventUpdatedDate = event.getLastUpdated(); console.log(eventUpdatedDate);

戻る

Date - 最終更新日

承認

このメソッドを使用するスクリプトには、次のスコープの 1 つ以上、または関連する REST API の適切なスコープによる承認が必要です。

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

getLocation()

イベントの場所を取得します。

// Opens the calendar by its ID. You must have edit access to the calendar. // TODO(developer): Replace the ID with your own. const calendar = CalendarApp.getCalendarById(     '[email protected]', );  // Gets the first event from the calendar for February 1st, 2023 that takes // place between 4:10 PM and 4:25 PM. For an event series, use // calendar.getEventSeriesById('[email protected]'); and replace the series // ID with your own. const event = calendar.getEvents(     new Date('Feb 01, 2023 16:10:00'),     new Date('Feb 01, 2023 16:25:00'),     )[0];  if (event) {   // If an event exists within the given time frame, sets the location of the   // event to Mumbai.   event.setLocation('Mumbai');    // Gets the location of the event and logs it.   const eventLocation = event.getLocation();   console.log(eventLocation); } else {   // If no event exists within the given time frame, logs that information to   // the console.   console.log('No events exist for the specified range'); }

戻る

String - イベントの場所

承認

このメソッドを使用するスクリプトには、次のスコープの 1 つ以上、または関連する REST API の適切なスコープによる承認が必要です。

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

getMyStatus()

有効なユーザーのイベント ステータス(参加中、招待済みなど)を取得します。有効なユーザーがイベントの所有者である場合は、常に GuestStatus.OWNER を返します。

// Opens the calendar by its ID. // TODO(developer): Replace the ID with your own. const calendar = CalendarApp.getCalendarById(     '[email protected].', );  // Gets the first event from the calendar for February 1st, 2023 that takes // place between 4:10 PM and 4:25 PM. For an event series, use // calendar.getEventSeriesById('[email protected]'); and replace the series // ID with your own. const event = calendar.getEvents(     new Date('Feb 01, 2023 16:10:00'),     new Date('Feb 01, 2023 16:25:00'),     )[0];  if (event) {   // If an event exists within the given time frame, gets the event status of   // the effective user and logs it.   const myStatus = event.getMyStatus();   console.log(myStatus.toString()); } else {   // If no event exists within the given time frame, logs that information to   // the console.   console.log('No events exist for the specified range'); }

戻る

GuestStatus - ステータス

承認

このメソッドを使用するスクリプトには、次のスコープの 1 つ以上、または関連する REST API の適切なスコープによる承認が必要です。

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

getOriginalCalendarId()

この予定が最初に作成されたカレンダーの ID を取得します。

// Opens the calendar by its ID. You must have edit access to the calendar. // TODO(developer): Replace the ID with your own. const calendar = CalendarApp.getCalendarById(     '[email protected]', );  // Gets the first event from the calendar for February 25th, 2023 that takes // place between 4:00 PM and 4:25 PM. For an event series, use // calendar.getEventSeriesById('[email protected]'); and replace the series // ID with your own. const event = calendar.getEvents(     new Date('Feb 25,2023 16:00:00'),     new Date('Feb 25,2023 16:25:00'),     )[0];  if (event) {   // If an event exists within the given time frame, gets the ID of the calendar   // where the event was originally created and logs it.   const calendarId = event.getOriginalCalendarId();   console.log(calendarId); } else {   // If no event exists within the given time frame, logs that information to   // the console.   console.log('No events exist for the specified range'); }

戻る

String - 元のカレンダーの ID

承認

このメソッドを使用するスクリプトには、次のスコープの 1 つ以上、または関連する REST API の適切なスコープによる承認が必要です。

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

getPopupReminders()

イベントのすべてのポップアップ リマインダーの分値を取得します。

// Opens the calendar by its ID. You must have edit access to the calendar. // TODO(developer): Replace the ID with your own. const calendar = CalendarApp.getCalendarById(     '[email protected]', );  // Gets the first event from the calendar for February 4th, 2023 that takes // place between 5:05 PM and 5:35 PM. For an event series, use // calendar.getEventSeriesById('[email protected]'); and replace the series // ID with your own. const event = calendar.getEvents(     new Date('Feb 04, 2023 17:05:00'),     new Date('Feb 04, 2023 17:35:00'),     )[0];  if (event) {   // If an event exists within the given time frame, adds two pop-up reminders   // to the event. The first reminder pops up 5 minutes before the event starts   // and the second reminder pops up 3 minutes before the event starts.   event.addPopupReminder(3);   event.addPopupReminder(5);    // Gets the minute values for all pop-up reminders for the event and logs it.   const popUpReminder = event.getPopupReminders();   console.log(popUpReminder); } else {   // If no event exists within the given time frame, logs that information to   // the console.   console.log('No events exist for the specified range'); }

戻る

Integer[] - 各値がリマインダーがトリガーされるイベントの分数に対応する配列

承認

このメソッドを使用するスクリプトには、次のスコープの 1 つ以上、または関連する REST API の適切なスコープによる承認が必要です。

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

getSmsReminders()

イベントのすべての SMS リマインダーの分値を取得します。

戻る

Integer[] - 各値がリマインダーがトリガーされるイベントの分数に対応する配列

承認

このメソッドを使用するスクリプトには、次のスコープの 1 つ以上、または関連する REST API の適切なスコープによる承認が必要です。

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

getTag(key)

イベントのタグ値を取得します。

パラメータ

名前説明
keyString

戻る

String - タグ値

承認

このメソッドを使用するスクリプトには、次のスコープの 1 つ以上、または関連する REST API の適切なスコープによる承認が必要です。

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

getTitle()

イベントのタイトルを取得します。

// Opens the calendar by its ID. You must have edit access to the calendar. // TODO(developer): Replace the ID with your own. const calendar = CalendarApp.getCalendarById(     '[email protected]', );  // Gets the first event from the calendar for January 31st, 2023 that takes // place between 9:05 AM and 9:15 AM. For an event series, use // calendar.getEventSeriesById('[email protected]'); and replace the series // ID with your own. const event = calendar.getEvents(     new Date('Jan 31, 2023 09:05:00'),     new Date('Jan 31, 2023 09:15:00'),     )[0];  if (event) {   // If an event exists within the given time frame, logs the title of the   // event.   console.log(event.getTitle()); } else {   // If no event exists within the given time frame, logs that information to   // the console.   console.log('No events exist for the specified range'); }

戻る

String - タイトル

承認

このメソッドを使用するスクリプトには、次のスコープの 1 つ以上、または関連する REST API の適切なスコープによる承認が必要です。

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

getTransparency()

イベントの透明度を取得します。このメソッドを使用して、予定が TRANSPARENT(その時間帯のカレンダーに [空き時間] と表示される)か OPAQUE (その時間帯のカレンダーに [予定あり] と表示される)かを判断します。

// Gets the first event from the default calendar for today. const today = new Date(); const event = CalendarApp.getDefaultCalendar().getEventsForDay(today)[0]; // Gets the event's transparency and logs it. const transparency = event.getTransparency(); Logger.log(transparency);

戻る

EventTransparency - 透明度値。

承認

このメソッドを使用するスクリプトには、次のスコープの 1 つ以上、または関連する REST API の適切なスコープによる承認が必要です。

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

getVisibility()

イベントの公開設定を取得します。

// Opens the calendar by its ID. You must have edit access to the calendar. // TODO(developer): Replace the ID with your own. const calendar = CalendarApp.getCalendarById(     '[email protected]', );  // Gets the first event from the calendar for February 1st, 2023 that takes // place between 4:10 PM and 4:25 PM. For an event series, use // calendar.getEventSeriesById('[email protected]'); and replace the series // ID with your own. const event = calendar.getEvents(     new Date('Feb 01, 2023 16:10:00'),     new Date('Feb 01, 2023 16:25:00'),     )[0];  if (event) {   // If an event exists within the given time frame, gets the visibility of the   // event and logs it.   const eventVisibility = event.getVisibility();   console.log(eventVisibility.toString()); } else {   // If no event exists within the given time frame, logs that information to   // the console.   console.log('No events exist for the specified range'); }

戻る

Visibility - 可視性の値

承認

このメソッドを使用するスクリプトには、次のスコープの 1 つ以上、または関連する REST API の適切なスコープによる承認が必要です。

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

guestsCanInviteOthers()

ゲストが他のゲストを招待できるかどうかを判断します。

// Opens the calendar by its ID. You must have view access to the calendar. // TODO(developer): Replace the ID with your own. const calendar = CalendarApp.getCalendarById(     '[email protected]', );  // Gets the first event from the calendar for February 1st, 2023 that takes // place between 9:35 AM and 9:40 AM. For an event series, use // calendar.getEventSeriesById('[email protected]'); and replace the series // ID with your own. const event = calendar.getEvents(     new Date('Feb 01, 2023 09:35:00'),     new Date('Feb 01, 2023 09:40:00'),     )[0];  if (event) {   // If an event exists within the given time frame, determines whether guests   // can invite other guests and logs it.   console.log(event.guestsCanInviteOthers()); } else {   // If no event exists within the given time frame, logs that information to   // the console.   console.log('No events exist for the specified range'); }

戻る

Boolean - ゲストが他のユーザーを招待できる場合は true、できない場合は false

承認

このメソッドを使用するスクリプトには、次のスコープの 1 つ以上、または関連する REST API の適切なスコープによる承認が必要です。

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

guestsCanModify()

ゲストが予定を変更できるかどうかを指定します。

// Opens the calendar by its ID. You must have edit access to the calendar. // TODO(developer): Replace the ID with your own. const calendar = CalendarApp.getCalendarById(     '[email protected]', );  // Gets the first event from the calendar for February 1st, 2023 that takes // place between 9:35 AM and 9:40 AM. For an event series, use // calendar.getEventSeriesById('[email protected]'); and replace the series // ID with your own. const event = calendar.getEvents(     new Date('Feb 01, 2023 09:35:00'),     new Date('Feb 01, 2023 09:40:00'),     )[0];  if (event) {   // If an event exists within the given time frame, sets the event so that   // guests can't modify it.   event.setGuestsCanModify(false);    // Determines whether guests can modify the event and logs it.   console.log(event.guestsCanModify()); } else {   // If no event exists within the given time frame, logs that information to   // the console.   console.log('No events exist for the specified range'); }

戻る

Boolean - ゲストが予定を変更できる場合は true、できない場合は false

承認

このメソッドを使用するスクリプトには、次のスコープの 1 つ以上、または関連する REST API の適切なスコープによる承認が必要です。

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

guestsCanSeeGuests()

ゲストが他のゲストを確認できるかどうかを判断します。

// Opens the calendar by its ID. You must have view access to the calendar. // TODO(developer): Replace the ID with your own. const calendar = CalendarApp.getCalendarById(     '[email protected]', );  // Gets the first event from the calendar for February 1st, 2023 that takes // place between 9:35 AM and 9:40 AM. For an event series, use // calendar.getEventSeriesById('[email protected]'); and replace the series // ID with your own. const event = calendar.getEvents(     new Date('Feb 01, 2023 09:35:00'),     new Date('Feb 01, 2023 09:40:00'),     )[0];  if (event) {   // If an event exists within the given time frame, determines whether guests   // can see other guests and logs it.   console.log(event.guestsCanSeeGuests()); } else {   // If no event exists within the given time frame, logs that information to   // the console.   console.log('No events exist for the specified range'); }

戻る

Boolean - ゲストが他のゲストを確認できる場合は true、できない場合は false

承認

このメソッドを使用するスクリプトには、次のスコープの 1 つ以上、または関連する REST API の適切なスコープによる承認が必要です。

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

isOwnedByMe()

自分がイベントのオーナーかどうかを判断します。

// Opens the calendar by its ID. You must have view access to the calendar. // TODO(developer): Replace the ID with your own. const calendar = CalendarApp.getCalendarById(     '[email protected]', );  // Gets the first event from the calendar for January 31st, 2023 that takes // place between 9:05 AM and 9:15 AM. For an event series, use // calendar.getEventSeriesById('[email protected]'); and replace the series // ID with your own. const event = calendar.getEvents(     new Date('Jan 31, 2023 09:05:00'),     new Date('Jan 31, 2023 09:15:00'),     )[0];  if (event) {   // If an event exists within the given time frame, determines whether you're   // the owner of the event and logs it.   console.log(event.isOwnedByMe()); } else {   // If no event exists within the given time frame, logs that information to   // the console.   console.log('No events exist for the specified range'); }

戻る

Boolean - イベントが有効なユーザーが所有している場合は true、そうでない場合は false

承認

このメソッドを使用するスクリプトには、次のスコープの 1 つ以上、または関連する REST API の適切なスコープによる承認が必要です。

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

removeAllReminders()

予定からすべてのリマインダーを削除します。

// Opens the calendar by its ID. You must have edit access to the calendar // TODO(developer): Replace the ID with your own. const calendar = CalendarApp.getCalendarById(     '[email protected]', );  // Gets the first event from the calendar for February 1st, 2023 that takes // place between 4:10 PM and 4:25 PM. For an event series, use // calendar.getEventSeriesById('[email protected]'); and replace the series // ID with your own. const event = calendar.getEvents(     new Date('Feb 1,2023 16:10:00'),     new Date('Feb 1,2023 16:25:00'),     )[0];  if (event) {   // If an event exists within the given time frame, removes all reminders from   // the event.   event.removeAllReminders(); } else {   // If no event exists within the given time frame, logs that information to   // the console.   console.log('No events exist for the specified range'); }

戻る

CalendarEventSeries - チェーン用の this CalendarEventSeries

承認

このメソッドを使用するスクリプトには、次のスコープの 1 つ以上、または関連する REST API の適切なスコープによる承認が必要です。

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

removeGuest(email)

予定からゲストを削除します。

// Example 1: Remove a guest from one event function removeGuestFromEvent() {   // Replace the below values with your own   const attendeeEmail =       '[email protected]';  // Email address of the person you need to remove   const calendarId =       '[email protected]';  // ID of calendar containing   // event   const eventId = '123abc';  // ID of event instance    const calendar = CalendarApp.getCalendarById(calendarId);   if (calendar === null) {     // Calendar not found     console.log('Calendar not found', calendarId);     return;   }   const event = calendar.getEventById(eventId);   if (event === null) {     // Event not found     console.log('Event not found', eventId);     return;   }   event.removeGuest(attendeeEmail); }  // Example 2: Remove a guest from all events on a calendar within a specified // timeframe function removeGuestFromAllEvents() {   // Replace the following values with your own   const attendeeEmail =       '[email protected]';  // Email address of the person you need to remove   const calendarId =       '[email protected]';  // ID of calendar with the   // events   const startDate = new Date(       'YYYY-MM-DD');  // The first date to remove the guest from the events   const endDate = new Date(       'YYYY-MM-DD');  // The last date to remove the attendee from the events    const calendar = CalendarApp.getCalendarById(calendarId);   if (calendar === null) {     // Calendar not found     console.log('Calendar not found', calendarId);     return;   }   // Get the events within the specified timeframe   const calEvents = calendar.getEvents(startDate, endDate);   console.log(calEvents.length);  // Checks how many events are found   // Loop through all events and remove the attendee from each of them   for (let i = 0; i < calEvents.length; i++) {     const event = calEvents[i];     event.removeGuest(attendeeEmail);   } }

パラメータ

名前説明
emailStringゲストのメールアドレス

戻る

CalendarEventSeries - チェーン用の this CalendarEventSeries

承認

このメソッドを使用するスクリプトには、次のスコープの 1 つ以上、または関連する REST API の適切なスコープによる承認が必要です。

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

resetRemindersToDefault()

カレンダーのデフォルト設定を使用してリマインダーをリセットします。

// Opens the calendar by its ID. You must have edit access to the calendar. // TODO(developer): Replace the ID with your own. const calendar = CalendarApp.getCalendarById(     '[email protected]', );  // Gets the first event from the calendar for February 1st, 2023 that takes // place between 4:10 PM and 4:25 PM. For an event series, use // calendar.getEventSeriesById('[email protected]'); and replace the series // ID with your own. const event = calendar.getEvents(     new Date('Feb 1, 2023 16:10:00'),     new Date('Feb 1, 2023 16:25:00'),     )[0];  if (event) {   // If an event exists within the given time frame, resets the reminders using   // the calendar's default settings.   event.resetRemindersToDefault(); } else {   // If no event exists within the given time frame, logs that information to   // the console.   console.log('No events exist for the specified range'); }

戻る

CalendarEventSeries - チェーン用の this CalendarEventSeries

承認

このメソッドを使用するスクリプトには、次のスコープの 1 つ以上、または関連する REST API の適切なスコープによる承認が必要です。

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

setAnyoneCanAddSelf(anyoneCanAddSelf)

ゲスト以外のユーザーが予定に自分自身を追加できるかどうかを設定します。

// Opens the calendar by its ID. You must have edit access to the calendar. // TODO(developer): Replace the ID with your own. const calendar = CalendarApp.getCalendarById(     '[email protected]', );  // Gets the first event from the calendar for February 15th, 2023 that takes // place between 3:30 PM and 4:30 PM. For an event series, use // calendar.getEventSeriesById('[email protected]'); and replace the series // ID with your own. const event = calendar.getEvents(     new Date('Feb 15, 2023 15:30:00'),     new Date('Feb 15, 2023 16:30:00'),     )[0];  if (event) {   // If an event exists within the given time frame, sets the event so that   // non-guests can't add themselves to the event.   event.setAnyoneCanAddSelf(false); } else {   // If no event exists within the given time frame, logs that information to   // the console.   console.log('No events exist for the specified range'); }

パラメータ

名前説明
anyoneCanAddSelfBoolean誰でも自分を招待できるかどうか

戻る

CalendarEventSeries - チェーン用の this CalendarEventSeries

承認

このメソッドを使用するスクリプトには、次のスコープの 1 つ以上、または関連する REST API の適切なスコープによる承認が必要です。

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

setColor(color)

カレンダーの予定の色を設定します。

// Opens the calendar by its ID. You must have edit access to the calendar. // TODO(developer): Replace the ID with your own. const calendar = CalendarApp.getCalendarById(     '[email protected]', );  // Gets the first event from the calendar for February 1st, 2023 that takes // place between 4:10 PM and 4:25 PM. For an event series, use // calendar.getEventSeriesById('[email protected]'); and replace the series // ID with your own. const event = calendar.getEvents(     new Date('Feb 01, 2023 16:10:00'),     new Date('Feb 01, 2023 16:25:00'),     )[0];  if (event) {   // If an event exists within the given time frame, sets the color of the   // calendar event to green.   event.setColor(CalendarApp.EventColor.GREEN); } else {   // If no event exists within the given time frame, logs that information to   // the console.   console.log('No events exist for the specified range'); }

パラメータ

名前説明
colorString整数の色インデックス(文字列)または CalendarApp.EventColor の値。

戻る

CalendarEventSeries - このカレンダーの予定(連結用)。

承認

このメソッドを使用するスクリプトには、次のスコープの 1 つ以上、または関連する REST API の適切なスコープによる承認が必要です。

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

setDescription(description)

イベントの説明を設定します。

// Opens the calendar by its ID. You must have edit access to the calendar. // TODO(developer): Replace the ID with your own. const calendar = CalendarApp.getCalendarById(     '[email protected]', );  // Gets the first event from the calendar for February 4th, 2023 that takes // place between 5:05 PM and 5:35 PM. For an event series, use // calendar.getEventSeriesById('[email protected]'); and replace the series // ID with your own. const event = calendar.getEvents(     new Date('Feb 04, 2023 17:05:00'),     new Date('Feb 04, 2023 17:35:00'),     )[0];  if (event) {   // If an event exists within the given time frame, sets the description of the   // event to 'Meeting.'   event.setDescription('Meeting'); } else {   // If no event exists within the given time frame, logs that information to   // the console.   console.log('No events exist for the specified range'); }

パラメータ

名前説明
descriptionString新しい説明

戻る

CalendarEventSeries - チェーン用の this CalendarEventSeries

承認

このメソッドを使用するスクリプトには、次のスコープの 1 つ以上、または関連する REST API の適切なスコープによる承認が必要です。

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

setGuestsCanInviteOthers(guestsCanInviteOthers)

ゲストが他のゲストを招待できるかどうかを設定します。

// Opens the calendar by its ID. // TODO(developer): Replace the ID with your own. You must have edit access to // the calendar. const calendar = CalendarApp.getCalendarById(     '[email protected]', );  // Gets the first event from the calendar for February 1st, 2023 that takes // place between 9:35 AM and 9:40 AM. For an event series, use // calendar.getEventSeriesById('[email protected]'); and replace the series // ID with your own. const event = calendar.getEvents(     new Date('Feb 01, 2023 09:35:00'),     new Date('Feb 01, 2023 09:40:00'),     )[0];  if (event) {   // If an event exists within the given time frame, sets the event so that   // guests can invite other guests.   event.setGuestsCanInviteOthers(true); } else {   // If no event exists within the given time frame, logs that information to   // the console.   console.log('No events exist for the specified range'); }

パラメータ

名前説明
guestsCanInviteOthersBooleanゲストが他のユーザーを招待できるかどうか

戻る

CalendarEventSeries - チェーン用の this CalendarEventSeries

承認

このメソッドを使用するスクリプトには、次のスコープの 1 つ以上、または関連する REST API の適切なスコープによる承認が必要です。

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

setGuestsCanModify(guestsCanModify)

ゲストが予定を変更できるかどうかを設定します。

パラメータ

名前説明
guestsCanModifyBooleanゲストが予定を変更できるかどうか

戻る

CalendarEventSeries - チェーン用の this CalendarEventSeries

承認

このメソッドを使用するスクリプトには、次のスコープの 1 つ以上、または関連する REST API の適切なスコープによる承認が必要です。

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

setGuestsCanSeeGuests(guestsCanSeeGuests)

ゲストが他のゲストを確認できるかどうかを設定します。

パラメータ

名前説明
guestsCanSeeGuestsBooleanゲストが他のゲストを確認できるかどうか

戻る

CalendarEventSeries - チェーン用の this CalendarEventSeries

承認

このメソッドを使用するスクリプトには、次のスコープの 1 つ以上、または関連する REST API の適切なスコープによる承認が必要です。

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

setLocation(location)

イベントの場所を設定します。

// Opens the calendar by its ID. You must have edit access to the calendar. // TODO(developer): Replace the ID with your own. const calendar = CalendarApp.getCalendarById(     '[email protected]', );  // Gets the first event from the calendar for February 1st, 2023 that takes // place between 4:10 PM and 4:25 PM. For an event series, use // calendar.getEventSeriesById('[email protected]'); and replace the series // ID with your own. const event = calendar.getEvents(     new Date('Feb 01, 2023 16:10:00'),     new Date('Feb 01, 2023 16:25:00'),     )[0];  if (event) {   // If an event exists within the given time frame, sets the location of the   // event to Noida.   event.setLocation('Noida'); } else {   // If no event exists within the given time frame, logs that information to   // the console.   console.log('No events exist for the specified range'); }

パラメータ

名前説明
locationString新しい場所

戻る

CalendarEventSeries - チェーン用の this CalendarEventSeries

承認

このメソッドを使用するスクリプトには、次のスコープの 1 つ以上、または関連する REST API の適切なスコープによる承認が必要です。

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

setMyStatus(status)

有効なユーザーのイベント ステータス(参加、招待など)を設定します。

// Opens the calendar by its ID. You must have edit access to the calendar. // TODO(developer): Replace the ID with your own. const calendar = CalendarApp.getCalendarById(     '[email protected]', );  // Gets the first event from the calendar for February 1st, 2023 that takes // place between 4:10 PM and 4:25 PM. For an event series, use // calendar.getEventSeriesById('[email protected]'); and replace the series // ID with your own. const event = calendar.getEvents(     new Date('Feb 01, 2023 16:10:00'),     new Date('Feb 01, 2023 16:25:00'),     )[0];  if (event) {   // If an event exists within the given time frame, sets the event status for   // the current user to maybe.   event.setMyStatus(CalendarApp.GuestStatus.MAYBE); } else {   // If no event exists within the given time frame, logs that information to   // the console.   console.log('No events exist for the specified range'); }

パラメータ

名前説明
statusGuestStatus新しいステータス

戻る

CalendarEventSeries - チェーン用の this CalendarEventSeries

承認

このメソッドを使用するスクリプトには、次のスコープの 1 つ以上、または関連する REST API の適切なスコープによる承認が必要です。

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

setRecurrence(recurrence, startDate)

終日の一連の予定の繰り返しルールを設定します。この方法を適用すると、通常の予定シリーズが終日の予定シリーズに変更されます。

// Sets the events in a series to take place every Wednesday in 2013. const eventSeries = CalendarApp.getDefaultCalendar().getEventSeriesById(     '[email protected]', ); const startDate = new Date('January 2, 2013 03:00:00 PM EST'); const recurrence = CalendarApp.newRecurrence()                        .addWeeklyRule()                        .onlyOnWeekday(CalendarApp.Weekday.WEDNESDAY)                        .until(new Date('January 1, 2014')); eventSeries.setRecurrence(recurrence, startDate);

パラメータ

名前説明
recurrenceEventRecurrence使用する繰り返しルール
startDateDateシリーズ内の最初のイベントの日付(日付のみが使用され、時刻は無視されます)

戻る

CalendarEventSeries - 連結するこの CalendarEventSeries

承認

このメソッドを使用するスクリプトには、次のスコープの 1 つ以上、または関連する REST API の適切なスコープによる承認が必要です。

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

setRecurrence(recurrence, startTime, endTime)

このイベントシリーズの繰り返しルールを設定します。この方法を適用すると、終日の予定シリーズが通常の予定シリーズに変更されます。

// Sets the events in a series to take place from 3pm to 4pm every Tuesday and // Thursday in 2013. const eventSeries = CalendarApp.getDefaultCalendar().getEventSeriesById(     '[email protected]', ); const startTime = new Date('January 1, 2013 03:00:00 PM EST'); const endTime = new Date('January 1, 2013 04:00:00 PM EST'); const recurrence =     CalendarApp.newRecurrence()         .addWeeklyRule()         .onlyOnWeekdays(             [CalendarApp.Weekday.TUESDAY, CalendarApp.Weekday.THURSDAY])         .until(new Date('January 1, 2014')); eventSeries.setRecurrence(recurrence, startTime, endTime);

パラメータ

名前説明
recurrenceEventRecurrence使用する繰り返しルール
startTimeDateシリーズの最初のイベントの開始日時
endTimeDateシリーズの最初のイベントが終了した日時

戻る

CalendarEventSeries - 連結するこの CalendarEventSeries

承認

このメソッドを使用するスクリプトには、次のスコープの 1 つ以上、または関連する REST API の適切なスコープによる承認が必要です。

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

setTag(key, value)

カスタム メタデータを保存するために、イベントに Key-Value タグを設定します。

パラメータ

名前説明
keyStringタグキー
valueStringタグの値

戻る

CalendarEventSeries - チェーン用の this CalendarEventSeries

承認

このメソッドを使用するスクリプトには、次のスコープの 1 つ以上、または関連する REST API の適切なスコープによる承認が必要です。

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

setTitle(title)

イベントのタイトルを設定します。

// Opens the calendar by its ID. You must have edit access to the calendar. // TODO(developer): Replace the ID with your own. const calendar = CalendarApp.getCalendarById(     '[email protected]', );  // Gets the first event from the calendar for January 31st, 2023 that takes // place between 9:05 AM and 9:15 AM. For an event series, use // calendar.getEventSeriesById('[email protected]'); and replace the series // ID with your own. const event = calendar.getEvents(     new Date('Jan 31, 2023 09:05:00'),     new Date('Jan 31, 2023 09:15:00'),     )[0];  if (event) {   // If an event exists within the given time frame, changes its title to   // Event1.   event.setTitle('Event1'); } else {   // If no event exists within the given time frame, logs that information to   // the console.   console.log('No events exist for the specified range'); }

パラメータ

名前説明
titleString新しいタイトル

戻る

CalendarEventSeries - チェーン用の this CalendarEventSeries

承認

このメソッドを使用するスクリプトには、次のスコープの 1 つ以上、または関連する REST API の適切なスコープによる承認が必要です。

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

setTransparency(transparency)

イベントの透明度を設定します。このメソッドを使用して、予定を TRANSPARENT(その時間帯のカレンダーに [予定なし] と表示)または OPAQUE (その時間帯のカレンダーに [予定あり] と表示)に設定します。

// Gets an event by its ID. For an event series, use getEventSeriesById(iCalId) // instead. // TODO(developer): Replace the string with the event ID that you want to get. const event = CalendarApp.getEventById('abc123456'); // Sets the event's transparency to TRANSPARENT. event.setTransparency(CalendarApp.EventTransparency.TRANSPARENT);

パラメータ

名前説明
transparencyEventTransparency透明度の値。

戻る

CalendarEventSeries - チェーン用の CalendarEventSeries

承認

このメソッドを使用するスクリプトには、次のスコープの 1 つ以上、または関連する REST API の適切なスコープによる承認が必要です。

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

setVisibility(visibility)

イベントの公開設定を設定します。

パラメータ

名前説明
visibilityVisibility

戻る

CalendarEventSeries - チェーン用の this CalendarEventSeries

承認

このメソッドを使用するスクリプトには、次のスコープの 1 つ以上、または関連する REST API の適切なスコープによる承認が必要です。

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