Class CalendarEventSeries

CalendarEventSeries

일련의 이벤트 (반복 이벤트)를 나타냅니다.

방법

메서드반환 유형간략한 설명
addEmailReminder(minutesBefore)CalendarEventSeries일정에 새 이메일 알림을 추가합니다.
addGuest(email)CalendarEventSeries일정에 참석자를 추가합니다.
addPopupReminder(minutesBefore)CalendarEventSeries일정에 새 팝업 알림을 추가합니다.
addSmsReminder(minutesBefore)CalendarEventSeries일정에 새 SMS 알림을 추가합니다.
anyoneCanAddSelf()Boolean사용자가 Calendar 일정에 자신을 참석자로 추가할 수 있는지 결정합니다.
deleteEventSeries()void일정 계열을 삭제합니다.
deleteTag(key)CalendarEventSeries이벤트에서 키/값 태그를 삭제합니다.
getAllTagKeys()String[]이벤트에 설정된 태그의 모든 키를 가져옵니다.
getColor()String캘린더 이벤트의 색상을 반환합니다.
getCreators()String[]이벤트 제작자를 가져옵니다.
getDateCreated()Date이벤트가 생성된 날짜를 가져옵니다.
getDescription()String이벤트 설명을 가져옵니다.
getEmailReminders()Integer[]일정에 대한 모든 이메일 알림의 분 값을 가져옵니다.
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이벤트 제목을 가져옵니다.
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커스텀 메타데이터를 저장하기 위한 키/값 태그를 이벤트에 설정합니다.
setTitle(title)CalendarEventSeries이벤트 제목을 설정합니다.
setVisibility(visibility)CalendarEventSeries이벤트의 공개 상태를 설정합니다.

자세한 문서

addEmailReminder(minutesBefore)

일정에 새 이메일 알림을 추가합니다. 알림은 이벤트 최소 5분 전, 최대 4주 (40,320분) 전이어야 합니다.

// 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: 이 CalendarEventSeries는 체이닝을 위한 것입니다.

생성 값

Error - 이벤트에 리마인더가 5개 이상 있거나 시간이 법적 범위 내에 있지 않은 경우

승인

이 방법을 사용하는 스크립트에는 다음 범위 중 하나 이상 또는 관련 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
  let attendeeEmail = 'user@example.com'; // Email address of the person you need to add
  let calendarId = 'calendar_123@group.calendar.google.com'; // ID of calendar containing event
  let eventId = '123abc'; // ID of event instance

  let calendar = CalendarApp.getCalendarById(calendarId);
  if (calendar === null) {
    // Calendar not found
    console.log('Calendar not found', calendarId);
    return;
    }
  let 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
  let attendeeEmail = 'user@example.com'; // Email address of the person you need to add
  let calendarId = 'calendar_123@group.calendar.google.com'; // ID of calendar with the events
  let startDate = new Date("YYYY-MM-DD"); // The first date to add the guest to the events
  let endDate = new Date("YYYY-MM-DD"); // The last date to add the guest to the events

  let calendar = CalendarApp.getCalendarById(calendarId);
    if (calendar === null) {
    // Calendar not found
    console.log('Calendar not found', calendarId);
    return;
  }
  // Get the events within the specified timeframe
  let 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 (var i = 0; i < calEvents.length; i++) {
  let event = calEvents[i];
  event.addGuest(attendeeEmail);
  }
}

매개변수

이름유형설명
emailString참석자의 이메일 주소입니다.

리턴

CalendarEventSeries: 체이닝을 위한 CalendarEventSeries입니다.

승인

이 방법을 사용하는 스크립트에는 다음 범위 중 하나 이상 또는 관련 REST API의 적절한 범위에 대한 인증이 필요합니다.

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

addPopupReminder(minutesBefore)

일정에 새 팝업 알림을 추가합니다. 알림은 이벤트 최소 5분 전, 최대 4주 (40,320분) 전에 전송되어야 합니다.

// 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: 이 CalendarEventSeries는 체이닝을 위한 것입니다.

승인

이 방법을 사용하는 스크립트에는 다음 범위 중 하나 이상 또는 관련 REST API의 적절한 범위에 대한 인증이 필요합니다.

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

addSmsReminder(minutesBefore)

일정에 새 SMS 알림을 추가합니다. 알림은 이벤트 최소 5분 전, 최대 4주 (40,320분) 전이어야 합니다.

매개변수

이름유형설명
minutesBeforeInteger일정까지 남은 시간(분)

리턴

CalendarEventSeries: 이 CalendarEventSeries는 체이닝을 위한 것입니다.

생성 값

Error - 이벤트에 리마인더가 5개 이상 있거나 시간이 법적 범위 내에 있지 않은 경우

승인

이 방법을 사용하는 스크립트에는 다음 범위 중 하나 이상 또는 관련 REST API의 적절한 범위에 대한 인증이 필요합니다.

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

anyoneCanAddSelf()

사용자가 Calendar 일정에 자신을 참석자로 추가할 수 있는지 결정합니다.

// 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입니다.

승인

이 방법을 사용하는 스크립트에는 다음 범위 중 하나 이상 또는 관련 REST API의 적절한 범위에 대한 인증이 필요합니다.

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

deleteEventSeries()

일정 계열을 삭제합니다.

승인

이 방법을 사용하는 스크립트에는 다음 범위 중 하나 이상 또는 관련 REST API의 적절한 범위에 대한 인증이 필요합니다.

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

deleteTag(key)

이벤트에서 키/값 태그를 삭제합니다.

매개변수

이름유형설명
keyString태그 키

리턴

CalendarEventSeries: 이 CalendarEventSeries는 체이닝을 위한 것입니다.

승인

이 방법을 사용하는 스크립트에는 다음 범위 중 하나 이상 또는 관련 REST API의 적절한 범위에 대한 인증이 필요합니다.

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

getAllTagKeys()

이벤트에 설정된 태그의 모든 키를 가져옵니다.

리턴

String[]: 문자열 키 배열

승인

이 방법을 사용하는 스크립트에는 다음 범위 중 하나 이상 또는 관련 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)으로 표현된 이벤트 색상을 문자열 표현한 것입니다.

승인

이 방법을 사용하는 스크립트에는 다음 범위 중 하나 이상 또는 관련 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[] — 이벤트 작성자의 이메일 주소입니다.

승인

이 방법을 사용하는 스크립트에는 다음 범위 중 하나 이상 또는 관련 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('abc123456@group.calendar.google.com');

// 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('abc123456@google.com');
// 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: 생성 날짜

승인

이 방법을 사용하는 스크립트에는 다음 범위 중 하나 이상 또는 관련 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('abc123456@group.calendar.google.com');

// 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('abc123456@google.com');
// 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: 설명

승인

이 방법을 사용하는 스크립트에는 다음 범위 중 하나 이상 또는 관련 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('abc123456@group.calendar.google.com');

// 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('abc123456@google.com');
// 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[] - 리마인더가 트리거하는 이벤트 전 시간(분)에 각 값이 해당하는 배열

승인

이 방법을 사용하는 스크립트에는 다음 범위 중 하나 이상 또는 관련 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('abc123456@group.calendar.google.com');

// 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('abc123456@google.com');
// 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('alex@example.com');

// If the email address corresponds to an event guest, logs the email address.
if (guestEmailId) {
  console.log(guestEmailId.getEmail());
}

매개변수

이름유형설명
emailString게스트의 주소

리턴

EventGuest — 게스트 또는 이메일 주소가 게스트와 일치하지 않는 경우 null입니다.

승인

이 방법을 사용하는 스크립트에는 다음 범위 중 하나 이상 또는 관련 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('abc123456@group.calendar.google.com');

// 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('abc123456@google.com');
// 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('alex@example.com');
event.addGuest('cruz@example.com');

// 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[]: 참석자의 배열

승인

이 방법을 사용하는 스크립트에는 다음 범위 중 하나 이상 또는 관련 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('abc123456@group.calendar.google.com');

// 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('abc123456@google.com');
// 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[]: 참석자의 배열

승인

이 방법을 사용하는 스크립트에는 다음 범위 중 하나 이상 또는 관련 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는 동일하지 않으며 서로 바꿔서 사용할 수 없습니다. 시맨틱스의 한 가지 차이점은 반복 이벤트에서 한 이벤트가 모두 발생하지만 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('abc123456@group.calendar.google.com');

// 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('abc123456@google.com');
// 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

승인

이 방법을 사용하는 스크립트에는 다음 범위 중 하나 이상 또는 관련 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('abc123456@group.calendar.google.com');

// 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('abc123456@google.com');
// 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: 최종 업데이트 날짜

승인

이 방법을 사용하는 스크립트에는 다음 범위 중 하나 이상 또는 관련 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('abc123456@group.calendar.google.com');

// 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('abc123456@google.com');
// 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: 일정 위치

승인

이 방법을 사용하는 스크립트에는 다음 범위 중 하나 이상 또는 관련 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('abc123456@group.calendar.google.');

// 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('abc123456@google.com');
// 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: 상태

승인

이 방법을 사용하는 스크립트에는 다음 범위 중 하나 이상 또는 관련 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('abc123456@group.calendar.google.com');

// 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('abc123456@google.com');
// 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

승인

이 방법을 사용하는 스크립트에는 다음 범위 중 하나 이상 또는 관련 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('abc123456@group.calendar.google.com');

// 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('abc123456@google.com');
// 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[] - 리마인더가 트리거하는 이벤트 전 시간(분)에 각 값이 해당하는 배열

승인

이 방법을 사용하는 스크립트에는 다음 범위 중 하나 이상 또는 관련 REST API의 적절한 범위에 대한 인증이 필요합니다.

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

getSmsReminders()

일정의 모든 SMS 알림의 분 값을 가져옵니다.

리턴

Integer[] - 리마인더가 트리거하는 이벤트 전 시간(분)에 각 값이 해당하는 배열

승인

이 방법을 사용하는 스크립트에는 다음 범위 중 하나 이상 또는 관련 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: 태그 값

승인

이 방법을 사용하는 스크립트에는 다음 범위 중 하나 이상 또는 관련 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('abc123456@group.calendar.google.com');

// 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('abc123456@google.com');
// 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: 제목

승인

이 방법을 사용하는 스크립트에는 다음 범위 중 하나 이상 또는 관련 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('abc123456@group.calendar.google.com');

// 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('abc123456@google.com');
// 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: 공개 상태 값

승인

이 방법을 사용하는 스크립트에는 다음 범위 중 하나 이상 또는 관련 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('abc123456@group.calendar.google.com');

// 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('abc123456@google.com');
// 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

승인

이 방법을 사용하는 스크립트에는 다음 범위 중 하나 이상 또는 관련 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('abc123456@group.calendar.google.com');

// 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('abc123456@google.com');
// 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입니다.

승인

이 방법을 사용하는 스크립트에는 다음 범위 중 하나 이상 또는 관련 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('abc123456@group.calendar.google.com');

// 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('abc123456@google.com');
// 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

승인

이 방법을 사용하는 스크립트에는 다음 범위 중 하나 이상 또는 관련 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('abc123456@group.calendar.google.com');

// 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('abc123456@google.com');
// 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

승인

이 방법을 사용하는 스크립트에는 다음 범위 중 하나 이상 또는 관련 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('abc123456@group.calendar.google.com');

// 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('abc123456@google.com');
// 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: 이 CalendarEventSeries는 체이닝을 위한 것입니다.

승인

이 방법을 사용하는 스크립트에는 다음 범위 중 하나 이상 또는 관련 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
  let attendeeEmail = 'user@example.com'; // Email address of the person you need to remove
  let calendarId = 'calendar_123@group.calendar.google.com'; // ID of calendar containing event
  let eventId = '123abc'; // ID of event instance

  let calendar = CalendarApp.getCalendarById(calendarId);
  if (calendar === null) {
    // Calendar not found
    console.log('Calendar not found', calendarId);
    return;
    }
  let 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
  let attendeeEmail = 'user@example.com'; // Email address of the person you need to remove
  let calendarId = 'calendar_123@group.calendar.google.com'; // ID of calendar with the events
  let startDate = new Date("YYYY-MM-DD"); // The first date to remove the guest from the events
  let endDate = new Date("YYYY-MM-DD"); // The last date to remove the attendee from the events

  let calendar = CalendarApp.getCalendarById(calendarId);
    if (calendar === null) {
    // Calendar not found
    console.log('Calendar not found', calendarId);
    return;
  }
  // Get the events within the specified timeframe
  let 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 (var i = 0; i < calEvents.length; i++) {
  let event = calEvents[i];
  event.removeGuest(attendeeEmail);
  }
}

매개변수

이름유형설명
emailString게스트의 이메일 주소

리턴

CalendarEventSeries: 이 CalendarEventSeries는 체이닝을 위한 것입니다.

승인

이 방법을 사용하는 스크립트에는 다음 범위 중 하나 이상 또는 관련 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('abc123456@group.calendar.google.com');

// 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('abc123456@google.com');
// 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: 이 CalendarEventSeries는 체이닝을 위한 것입니다.

승인

이 방법을 사용하는 스크립트에는 다음 범위 중 하나 이상 또는 관련 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('abc123456@group.calendar.google.com');

// 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('abc123456@google.com');
// 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: 이 CalendarEventSeries는 체이닝을 위한 것입니다.

승인

이 방법을 사용하는 스크립트에는 다음 범위 중 하나 이상 또는 관련 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('abc123456@group.calendar.google.com');

// 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('abc123456@google.com');
// 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 - 연결을 위한 이 캘린더 이벤트입니다.

승인

이 방법을 사용하는 스크립트에는 다음 범위 중 하나 이상 또는 관련 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('abc123456@group.calendar.google.com');

// 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('abc123456@google.com');
// 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: 이 CalendarEventSeries는 체이닝을 위한 것입니다.

승인

이 방법을 사용하는 스크립트에는 다음 범위 중 하나 이상 또는 관련 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('abc123456@group.calendar.google.com');

// 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('abc123456@google.com');
// 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: 이 CalendarEventSeries는 체이닝을 위한 것입니다.

승인

이 방법을 사용하는 스크립트에는 다음 범위 중 하나 이상 또는 관련 REST API의 적절한 범위에 대한 인증이 필요합니다.

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

setGuestsCanModify(guestsCanModify)

참석자가 일정을 수정할 수 있는지 여부를 설정합니다.

매개변수

이름유형설명
guestsCanModifyBoolean참석자가 일정을 수정할 수 있는지 여부

리턴

CalendarEventSeries: 이 CalendarEventSeries는 체이닝을 위한 것입니다.

승인

이 방법을 사용하는 스크립트에는 다음 범위 중 하나 이상 또는 관련 REST API의 적절한 범위에 대한 인증이 필요합니다.

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

setGuestsCanSeeGuests(guestsCanSeeGuests)

게스트가 다른 참석자를 볼 수 있는지 여부를 설정합니다.

매개변수

이름유형설명
guestsCanSeeGuestsBoolean참석자가 다른 사용자를 볼 수 있는지 여부

리턴

CalendarEventSeries: 이 CalendarEventSeries는 체이닝을 위한 것입니다.

승인

이 방법을 사용하는 스크립트에는 다음 범위 중 하나 이상 또는 관련 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('abc123456@group.calendar.google.com');

// 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('abc123456@google.com');
// 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: 이 CalendarEventSeries는 체이닝을 위한 것입니다.

승인

이 방법을 사용하는 스크립트에는 다음 범위 중 하나 이상 또는 관련 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('abc123456@group.calendar.google.com');

// 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('abc123456@google.com');
// 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: 이 CalendarEventSeries는 체이닝을 위한 것입니다.

승인

이 방법을 사용하는 스크립트에는 다음 범위 중 하나 이상 또는 관련 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.
var eventSeries = CalendarApp.getDefaultCalendar().getEventSeriesById('123456789@google.com');
var startDate = new Date('January 2, 2013 03:00:00 PM EST');
var recurrence = CalendarApp.newRecurrence().addWeeklyRule()
    .onlyOnWeekday(CalendarApp.Weekday.WEDNESDAY)
    .until(new Date('January 1, 2014'));
eventSeries.setRecurrence(recurrence, startDate);

매개변수

이름유형설명
recurrenceEventRecurrence반복 규칙을
startDateDate일련의 첫 번째 이벤트의 날짜 (날짜만 사용되며 시간은 무시됨)

리턴

CalendarEventSeries: 연결을 위한 이 CalendarEventSeries

승인

이 방법을 사용하는 스크립트에는 다음 범위 중 하나 이상 또는 관련 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.
var eventSeries = CalendarApp.getDefaultCalendar().getEventSeriesById('123456789@google.com');
var startTime = new Date('January 1, 2013 03:00:00 PM EST');
var endTime = new Date('January 1, 2013 04:00:00 PM EST');
var 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

승인

이 방법을 사용하는 스크립트에는 다음 범위 중 하나 이상 또는 관련 REST API의 적절한 범위에 대한 인증이 필요합니다.

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

setTag(key, value)

커스텀 메타데이터를 저장하기 위한 키/값 태그를 이벤트에 설정합니다.

매개변수

이름유형설명
keyString태그 키
valueString태그 값

리턴

CalendarEventSeries: 이 CalendarEventSeries는 체이닝을 위한 것입니다.

승인

이 방법을 사용하는 스크립트에는 다음 범위 중 하나 이상 또는 관련 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('abc123456@group.calendar.google.com');

// 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('abc123456@google.com');
// 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: 이 CalendarEventSeries는 체이닝을 위한 것입니다.

승인

이 방법을 사용하는 스크립트에는 다음 범위 중 하나 이상 또는 관련 REST API의 적절한 범위에 대한 인증이 필요합니다.

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

setVisibility(visibility)

이벤트의 공개 상태를 설정합니다.

매개변수

이름유형설명
visibilityVisibility

리턴

CalendarEventSeries: 이 CalendarEventSeries는 체이닝을 위한 것입니다.

승인

이 방법을 사용하는 스크립트에는 다음 범위 중 하나 이상 또는 관련 REST API의 적절한 범위에 대한 인증이 필요합니다.

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