단일 캘린더 일정을 나타냅니다.
메서드
| 메서드 | 반환 유형 | 간략한 설명 |
|---|---|---|
add | Calendar | 이벤트에 새 이메일 알림을 추가합니다. |
add | Calendar | 일정에 참석자를 추가합니다. |
add | Calendar | 일정에 새 팝업 알림을 추가합니다. |
add | Calendar | 일정에 새 SMS 알림을 추가합니다. |
anyone | Boolean | 사용자가 Calendar 일정에 참석자로 추가할 수 있는지 여부를 결정합니다. |
delete | void | Calendar 일정을 삭제합니다. |
delete | Calendar | 이벤트에서 키/값 태그를 삭제합니다. |
get | Date | 이 종일 캘린더 이벤트가 종료되는 날짜를 가져옵니다. |
get | Date | 이 종일 캘린더 이벤트가 시작되는 날짜를 가져옵니다. |
get | String[] | 이벤트에 설정된 태그의 모든 키를 가져옵니다. |
get | String | 캘린더 일정의 색상을 반환합니다. |
get | String[] | 일정의 작성자를 가져옵니다. |
get | Date | 이벤트가 생성된 날짜를 가져옵니다. |
get | String | 이벤트의 설명을 가져옵니다. |
get | Integer[] | 일정의 모든 이메일 리마인더의 분 값을 가져옵니다. |
get | Date | 이 캘린더 이벤트가 종료되는 날짜와 시간을 가져옵니다. |
get | Calendar | 이 이벤트가 속한 반복 일정 시리즈를 가져옵니다. |
get | Event | 이 이벤트의 Event를 가져옵니다. |
get | Event | 이메일 주소로 게스트를 가져옵니다. |
get | Event | 일정 소유자를 제외한 일정의 참석자를 가져옵니다. |
get | Event | 일정의 참석자를 가져옵니다. 여기에는 일정 소유자가 포함될 수 있습니다. |
get | String | 일정의 고유 iCalUID를 가져옵니다. |
get | Date | 이벤트가 마지막으로 업데이트된 날짜를 가져옵니다. |
get | String | 이벤트의 위치를 가져옵니다. |
get | Guest | 유효한 사용자의 이벤트 상태 (예: 참석 또는 초대됨)를 가져옵니다. |
get | String | 이 이벤트가 원래 생성된 캘린더의 ID를 가져옵니다. |
get | Integer[] | 이벤트의 모든 팝업 리마인더의 분 값을 가져옵니다. |
get | Integer[] | 일정의 모든 SMS 리마인더의 분 값을 가져옵니다. |
get | Date | 이 캘린더 이벤트가 시작되는 날짜와 시간을 가져옵니다. |
get | String | 이벤트의 태그 값을 가져옵니다. |
get | String | 이벤트의 제목을 가져옵니다. |
get | Event | 이벤트의 투명도를 가져옵니다. |
get | Visibility | 이벤트의 공개 상태를 가져옵니다. |
guests | Boolean | 참석자가 다른 참석자를 초대할 수 있는지 여부를 결정합니다. |
guests | Boolean | 참석자가 일정을 수정할 수 있는지 여부를 결정합니다. |
guests | Boolean | 참석자가 다른 참석자를 볼 수 있는지 여부를 결정합니다. |
is | Boolean | 종일 일정인지 여부를 결정합니다. |
is | Boolean | 내가 이벤트의 소유자인지 확인합니다. |
is | Boolean | 이벤트가 이벤트 시리즈의 일부인지 여부를 확인합니다. |
remove | Calendar | 일정에서 모든 알림을 삭제합니다. |
remove | Calendar | 일정에서 참석자를 삭제합니다. |
reset | Calendar | 캘린더의 기본 설정을 사용하여 알림을 재설정합니다. |
set | Calendar | 이벤트 날짜를 설정합니다. |
set | Calendar | 이벤트의 날짜를 설정합니다. |
set | Calendar | 참석자가 아닌 사용자가 일정에 자신을 추가할 수 있는지 여부를 설정합니다. |
set | Calendar | 캘린더 일정의 색상을 설정합니다. |
set | Calendar | 이벤트의 설명을 설정합니다. |
set | Calendar | 참석자가 다른 참석자를 초대할 수 있는지 여부를 설정합니다. |
set | Calendar | 참석자가 일정을 수정할 수 있는지 여부를 설정합니다. |
set | Calendar | 참석자가 다른 참석자를 볼 수 있는지 여부를 설정합니다. |
set | Calendar | 이벤트의 위치를 설정합니다. |
set | Calendar | 효과적인 사용자의 이벤트 상태 (예: 참석 또는 초대됨)를 설정합니다. |
set | Calendar | 커스텀 메타데이터를 저장하기 위해 이벤트에 키/값 태그를 설정합니다. |
set | Calendar | 이벤트의 시작 및 종료 날짜와 시간을 설정합니다. |
set | Calendar | 일정 제목을 설정합니다. |
set | Calendar | 이벤트의 투명도를 설정합니다. |
set | Calendar | 이벤트의 공개 상태를 설정합니다. |
자세한 문서
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);
매개변수
| 이름 | 유형 | 설명 |
|---|---|---|
minutes | Integer | 일정 전 시간(분) |
리턴
CalendarEvent - 연결을 위한 CalendarEvent
생성 값
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 const attendeeEmail = 'user@example.com'; // Email address of the person you need to add const calendarId = 'calendar_123@group.calendar.google.com'; // 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 = 'user@example.com'; // Email address of the person you need to add const calendarId = 'calendar_123@group.calendar.google.com'; // 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); } }
매개변수
| 이름 | 유형 | 설명 |
|---|---|---|
email | String | 게스트의 이메일 주소입니다. |
리턴
CalendarEvent — 체이닝을 위한 CalendarEvent입니다.
승인
이 메서드를 사용하는 스크립트에는 다음 범위 중 하나 이상 또는 관련 REST API의 적절한 범위에 대한 승인이 필요합니다.
-
https://www.googleapis.com/auth/calendar -
https://www.google.com/calendar/feeds
addPopupReminder(minutesBefore)
일정에 새 팝업 알림을 추가합니다. 알림은 이벤트 시작 최소 5분 전, 최대 4주 (40320분) 전에 전송되어야 합니다.
// 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);
매개변수
| 이름 | 유형 | 설명 |
|---|---|---|
minutes | Integer | 일정 전 시간(분) |
리턴
CalendarEvent - 연결을 위한 CalendarEvent
승인
이 메서드를 사용하는 스크립트에는 다음 범위 중 하나 이상 또는 관련 REST API의 적절한 범위에 대한 승인이 필요합니다.
-
https://www.googleapis.com/auth/calendar -
https://www.google.com/calendar/feeds
addSmsReminder(minutesBefore)
일정에 새 SMS 알림을 추가합니다. 알림은 이벤트 시작 최소 5분 전, 최대 4주 (40,320분) 전에 설정해야 합니다.
매개변수
| 이름 | 유형 | 설명 |
|---|---|---|
minutes | Integer | 일정 전 시간(분) |
리턴
CalendarEvent - 연결을 위한 CalendarEvent
생성 값
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
deleteEvent()
Calendar 일정을 삭제합니다.
// Gets an event by its ID. // TODO(developer): Replace the string with the ID of the event that you want to // delete. const event = CalendarApp.getEventById('abc123456'); // Deletes the event. event.deleteEvent();
승인
이 메서드를 사용하는 스크립트에는 다음 범위 중 하나 이상 또는 관련 REST API의 적절한 범위에 대한 승인이 필요합니다.
-
https://www.googleapis.com/auth/calendar -
https://www.google.com/calendar/feeds
deleteTag(key)
이벤트에서 키/값 태그를 삭제합니다.
매개변수
| 이름 | 유형 | 설명 |
|---|---|---|
key | String | 태그 키 |
리턴
CalendarEvent - 연결을 위한 CalendarEvent
승인
이 메서드를 사용하는 스크립트에는 다음 범위 중 하나 이상 또는 관련 REST API의 적절한 범위에 대한 승인이 필요합니다.
-
https://www.googleapis.com/auth/calendar -
https://www.google.com/calendar/feeds
getAllDayEndDate()
이 종일 캘린더 이벤트가 종료되는 날짜를 가져옵니다. (종일 일정이 아닌 경우 이 메서드는 예외를 발생시킵니다.) 반환된 Date는 스크립트의 시간대에서 이벤트가 종료된 다음 날의 자정을 나타냅니다. 대신 캘린더의 시간대를 사용하려면 getEndTime()를 호출하세요.
// Gets the user's default calendar. To get a different calendar, // use getCalendarById() instead. const calendar = CalendarApp.getDefaultCalendar(); // Creates an event named 'My all-day event' for May 16, 2023. const event = calendar.createAllDayEvent( 'My all-day event', new Date('May 16, 2023'), ); // Gets the event's end date and logs it. const endDate = event.getAllDayEndDate(); console.log(endDate);
리턴
Date: 이 종일 캘린더 일정의 종료일
생성 값
Error - 이 이벤트가 종일 이벤트가 아닌 경우
승인
이 메서드를 사용하는 스크립트에는 다음 범위 중 하나 이상 또는 관련 REST API의 적절한 범위에 대한 승인이 필요합니다.
-
https://www.googleapis.com/auth/calendar -
https://www.googleapis.com/auth/calendar.readonly -
https://www.google.com/calendar/feeds
getAllDayStartDate()
이 종일 캘린더 이벤트가 시작되는 날짜를 가져옵니다. (종일 일정이 아닌 경우 이 메서드는 예외를 발생시킵니다.) 반환된 Date는 스크립트의 시간대에서 이벤트가 시작되는 날짜의 자정을 나타냅니다. 대신 캘린더의 시간대를 사용하려면 getStartTime()를 호출하세요.
// Gets the user's default calendar. To get a different calendar, // use getCalendarById() instead. const calendar = CalendarApp.getDefaultCalendar(); // Creates an event named 'My all-day event' for May 16, 2023. const event = calendar.createAllDayEvent( 'My all-day event', new Date('May 16, 2023'), ); // Gets the event's start date and logs it. const startDate = event.getAllDayStartDate(); console.log(startDate);
리턴
Date - 이 종일 캘린더 일정의 시작일
생성 값
Error - 이 이벤트가 종일 이벤트가 아닌 경우
승인
이 메서드를 사용하는 스크립트에는 다음 범위 중 하나 이상 또는 관련 REST API의 적절한 범위에 대한 승인이 필요합니다.
-
https://www.googleapis.com/auth/calendar -
https://www.googleapis.com/auth/calendar.readonly -
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
getEndTime()
이 캘린더 이벤트가 종료되는 날짜와 시간을 가져옵니다. 캘린더에 대한 액세스 권한이 있어야 합니다. 종일 일정이 아닌 경우 이벤트가 종료되도록 정의된 시간입니다. 종료일만 저장하는 종일 일정 (날짜와 시간 아님)의 경우 캘린더의 시간대에서 이벤트가 종료된 후 다음 날의 자정입니다. 이렇게 하면 모든 유형의 이벤트의 종료 시간을 의미 있게 비교할 수 있지만 원래 연중일이 수정되지 않은 상태로 유지되지는 않습니다.
하루 종일 이벤트의 경우 이 메서드보다 getAllDayEndDate()를 호출하는 것이 거의 항상 좋습니다.
// 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 1st, 2023 that takes // place between 4:00 PM and 5:00 PM. const event = calendar.getEvents( new Date('Feb 01, 2023 16:00:00'), new Date('Feb 01, 2023 17:00:00'), )[0]; if (event) { // If an event exists within the given time frame, gets the date and time at // which the event ends and logs it. console.log(event.getEndTime()); } else { // If no event exists within the given time frame, logs that info 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
getEventSeries()
이 이벤트가 속한 반복 일정 시리즈를 가져옵니다. 캘린더에 액세스할 수 있어야 합니다. 이 이벤트가 시리즈에 속하지 않더라도 새 반복 설정을 추가할 수 있도록 CalendarEventSeries 객체가 반환됩니다.
// 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 18th, 2023 that takes // place between 1:00 PM and 2:00 PM. const event = calendar.getEvents( new Date('Feb 18, 2023 13:00:00'), new Date('Feb 18, 2023 14:00:00'), )[0]; if (event) { // If an event exists within the given time frame, gets the event series for // the event and sets the color to pale green. event.getEventSeries().setColor(CalendarApp.EventColor.PALE_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'); }
리턴
CalendarEventSeries - 이 이벤트가 속한 이벤트 시리즈 또는 아직 시리즈에 속하지 않은 경우 새 이벤트 시리즈
승인
이 메서드를 사용하는 스크립트에는 다음 범위 중 하나 이상 또는 관련 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 - 이벤트 유형입니다.
승인
이 메서드를 사용하는 스크립트에는 다음 범위 중 하나 이상 또는 관련 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()); }
매개변수
| 이름 | 유형 | 설명 |
|---|---|---|
email | String | 게스트의 주소 |
리턴
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()); }
매개변수
| 이름 | 유형 | 설명 |
|---|---|---|
include | Boolean | 소유자를 게스트로 포함할지 여부 |
리턴
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 API 및 Calendar 고급 서비스에서 사용하는 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
getStartTime()
이 캘린더 이벤트가 시작되는 날짜와 시간을 가져옵니다. 종일이 아닌 일정의 경우 이는 일정이 시작되도록 정의된 시간입니다. 시작일만 저장하고 날짜와 시간은 저장하지 않는 종일 일정의 경우 이는 캘린더의 시간대에서 이벤트가 시작되는 날짜의 자정입니다. 이렇게 하면 모든 유형의 이벤트 시작 시간을 의미 있게 비교할 수 있지만 원래 연중일이 수정되지 않은 상태로 유지되지는 않습니다.
하루 종일 이벤트의 경우 이 메서드보다 getAllDayStartDate()를 호출하는 것이 거의 항상 좋습니다.
// 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. const event = calendar.getEvents( new Date('Feb 01, 2023 16:10:00'), new Date('Feb 01, 2023 16:25:00'), )[0]; // Gets the date and time at which this calendar event begins and logs it. const startTime = event.getStartTime(); console.log(startTime);
리턴
Date - 이 캘린더 일정의 시작 시간
승인
이 메서드를 사용하는 스크립트에는 다음 범위 중 하나 이상 또는 관련 REST API의 적절한 범위에 대한 승인이 필요합니다.
-
https://www.googleapis.com/auth/calendar -
https://www.googleapis.com/auth/calendar.readonly -
https://www.google.com/calendar/feeds
getTag(key)
이벤트의 태그 값을 가져옵니다.
매개변수
| 이름 | 유형 | 설명 |
|---|---|---|
key | String | 키 |
리턴
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@example.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
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 - 투명도 값입니다.
승인
이 메서드를 사용하는 스크립트에는 다음 범위 중 하나 이상 또는 관련 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
isAllDayEvent()
종일 일정인지 여부를 결정합니다.
// 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. const event = calendar.getEvents( new Date('Jan 31, 2023 09:05:00'), new Date('Jan 31, 2023 09:15:00'), )[0]; // Determines whether this event is an all-day event and logs it. console.log(event.isAllDayEvent());
리턴
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
isRecurringEvent()
이벤트가 이벤트 시리즈의 일부인지 여부를 확인합니다.
// 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 Januart 31st, 2023 that takes // place between 9:00 AM and 10:00 AM. const event = calendar.getEvents( new Date('Jan 31, 2023 09:00:00'), new Date('Jan 31, 2023 10:00:00'), )[0]; if (event) { // If an event exists within the given time frame, determines whether the // event is part of an event series and logs it. console.log(event.isRecurringEvent()); } 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'); }
리턴
CalendarEvent - 연결을 위한 CalendarEvent
승인
이 메서드를 사용하는 스크립트에는 다음 범위 중 하나 이상 또는 관련 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 = 'user@example.com'; // Email address of the person you need to remove const calendarId = 'calendar_123@group.calendar.google.com'; // 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 = 'user@example.com'; // Email address of the person you need to remove const calendarId = 'calendar_123@group.calendar.google.com'; // 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); } }
매개변수
| 이름 | 유형 | 설명 |
|---|---|---|
email | String | 게스트의 이메일 주소 |
리턴
CalendarEvent - 연결을 위한 CalendarEvent
승인
이 메서드를 사용하는 스크립트에는 다음 범위 중 하나 이상 또는 관련 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'); }
리턴
CalendarEvent - 연결을 위한 CalendarEvent
승인
이 메서드를 사용하는 스크립트에는 다음 범위 중 하나 이상 또는 관련 REST API의 적절한 범위에 대한 승인이 필요합니다.
-
https://www.googleapis.com/auth/calendar -
https://www.google.com/calendar/feeds
setAllDayDate(date)
이벤트 날짜를 설정합니다. 이 메서드를 적용하면 일반 일정이 종일 일정으로 변경됩니다.
// 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 17th, 2023 that takes // place between 4:00 PM and 5:00 PM. const event = calendar.getEvents( new Date('Feb 17, 2023 16:00:00'), new Date('Feb 17, 2023 17:00:00'), )[0]; if (event) { // If an event exists within the given time frame, sets the date of the event // and updates it to an all-day event. event.setAllDayDate(new Date('Feb 17, 2023')); } 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 | Date | 이벤트 날짜 (시간은 무시됨) |
리턴
CalendarEvent - 연결을 위한 이 CalendarEvent
승인
이 메서드를 사용하는 스크립트에는 다음 범위 중 하나 이상 또는 관련 REST API의 적절한 범위에 대한 승인이 필요합니다.
-
https://www.googleapis.com/auth/calendar -
https://www.google.com/calendar/feeds
setAllDayDates(startDate, endDate)
이벤트의 날짜를 설정합니다. 이 메서드를 적용하면 일반 일정이 하루 종일 일정으로 변경됩니다.
// 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 18th, 2023 that takes // place between 4:00 PM and 5:00 PM. const event = calendar.getEvents( new Date('Feb 18, 2023 16:00:00'), new Date('Feb 18, 2023 17:00:00'), )[0]; if (event) { // If an event exists within the given time frame, sets the event to be an // all-day event from Feb 18th, 2023 until Feb 25th, 2023. Applying this // method changes a regular event into an all-day event. event.setAllDayDates(new Date('Feb 18, 2023'), new Date('Feb 25, 2023')); } 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'); }
매개변수
| 이름 | 유형 | 설명 |
|---|---|---|
start | Date | 이벤트가 시작되는 날짜 (시간은 무시됨) |
end | Date | 이벤트가 종료되는 날짜 (시간은 무시됨) |
리턴
CalendarEvent - 연결을 위한 이 CalendarEvent
승인
이 메서드를 사용하는 스크립트에는 다음 범위 중 하나 이상 또는 관련 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'); }
매개변수
| 이름 | 유형 | 설명 |
|---|---|---|
anyone | Boolean | 누구나 자신을 초대할 수 있는지 여부 |
리턴
CalendarEvent - 연결을 위한 CalendarEvent
승인
이 메서드를 사용하는 스크립트에는 다음 범위 중 하나 이상 또는 관련 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'); }
매개변수
| 이름 | 유형 | 설명 |
|---|---|---|
color | String | 문자열로 된 정수 색인 또는 Calendar의 값입니다. |
리턴
CalendarEvent - 체이닝을 위한 이 캘린더 일정입니다.
승인
이 메서드를 사용하는 스크립트에는 다음 범위 중 하나 이상 또는 관련 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'); }
매개변수
| 이름 | 유형 | 설명 |
|---|---|---|
description | String | 새 설명 |
리턴
CalendarEvent - 연결을 위한 CalendarEvent
승인
이 메서드를 사용하는 스크립트에는 다음 범위 중 하나 이상 또는 관련 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'); }
매개변수
| 이름 | 유형 | 설명 |
|---|---|---|
guests | Boolean | 참석자가 다른 사용자를 초대할 수 있는지 여부 |
리턴
CalendarEvent - 연결을 위한 CalendarEvent
승인
이 메서드를 사용하는 스크립트에는 다음 범위 중 하나 이상 또는 관련 REST API의 적절한 범위에 대한 승인이 필요합니다.
-
https://www.googleapis.com/auth/calendar -
https://www.google.com/calendar/feeds
setGuestsCanModify(guestsCanModify)
참석자가 일정을 수정할 수 있는지 여부를 설정합니다.
매개변수
| 이름 | 유형 | 설명 |
|---|---|---|
guests | Boolean | 참석자가 일정을 수정할 수 있는지 여부 |
리턴
CalendarEvent - 연결을 위한 CalendarEvent
승인
이 메서드를 사용하는 스크립트에는 다음 범위 중 하나 이상 또는 관련 REST API의 적절한 범위에 대한 승인이 필요합니다.
-
https://www.googleapis.com/auth/calendar -
https://www.google.com/calendar/feeds
setGuestsCanSeeGuests(guestsCanSeeGuests)
참석자가 다른 참석자를 볼 수 있는지 여부를 설정합니다.
매개변수
| 이름 | 유형 | 설명 |
|---|---|---|
guests | Boolean | 참석자가 다른 참석자를 볼 수 있는지 여부 |
리턴
CalendarEvent - 연결을 위한 CalendarEvent
승인
이 메서드를 사용하는 스크립트에는 다음 범위 중 하나 이상 또는 관련 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'); }
매개변수
| 이름 | 유형 | 설명 |
|---|---|---|
location | String | 새 위치 |
리턴
CalendarEvent - 연결을 위한 CalendarEvent
승인
이 메서드를 사용하는 스크립트에는 다음 범위 중 하나 이상 또는 관련 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'); }
매개변수
| 이름 | 유형 | 설명 |
|---|---|---|
status | Guest | 새 상태 |
리턴
CalendarEvent - 연결을 위한 CalendarEvent
승인
이 메서드를 사용하는 스크립트에는 다음 범위 중 하나 이상 또는 관련 REST API의 적절한 범위에 대한 승인이 필요합니다.
-
https://www.googleapis.com/auth/calendar -
https://www.googleapis.com/auth/calendar.readonly -
https://www.google.com/calendar/feeds
setTag(key, value)
커스텀 메타데이터를 저장하기 위해 이벤트에 키/값 태그를 설정합니다.
매개변수
| 이름 | 유형 | 설명 |
|---|---|---|
key | String | 태그 키 |
value | String | 태그 값 |
리턴
CalendarEvent - 연결을 위한 CalendarEvent
승인
이 메서드를 사용하는 스크립트에는 다음 범위 중 하나 이상 또는 관련 REST API의 적절한 범위에 대한 승인이 필요합니다.
-
https://www.googleapis.com/auth/calendar -
https://www.google.com/calendar/feeds
setTime(startTime, endTime)
이벤트의 시작 및 종료 날짜와 시간을 설정합니다. 이 메서드를 적용하면 하루 종일 이벤트가 일반 이벤트로 변경됩니다.
// Opens the calendar by its ID. // TODO(developer): Replace the ID with your own. const calendar = CalendarApp.getCalendarById( 'abc123456@group.calendar.google.com', ); // Declares a start time of 11:00 AM on February 20th, 2023 and an end time of // 12:00 PM on February 20th, 2023. const startTime = new Date('Feb 20,2023 11:00:00'); const endTime = new Date('Feb 20, 2023 12:00:00'); // Creates an all-day event on February 20th, 2023. const event = calendar.createAllDayEvent('Meeting', new Date('Feb 20,2023')); // Updates the all-day event to a regular event by setting a start and end time // for the event. event.setTime(startTime, endTime);
매개변수
| 이름 | 유형 | 설명 |
|---|---|---|
start | Date | 이벤트의 새로운 시작 |
end | Date | 새로운 이벤트 종료 |
리턴
CalendarEvent - 연결을 위한 이 CalendarEvent
승인
이 메서드를 사용하는 스크립트에는 다음 범위 중 하나 이상 또는 관련 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@example.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'); }
매개변수
| 이름 | 유형 | 설명 |
|---|---|---|
title | String | 새 제목 |
리턴
CalendarEvent - 연결을 위한 CalendarEvent
승인
이 메서드를 사용하는 스크립트에는 다음 범위 중 하나 이상 또는 관련 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);
매개변수
| 이름 | 유형 | 설명 |
|---|---|---|
transparency | Event | 투명도 값입니다. |
리턴
CalendarEvent — 체이닝을 위한 CalendarEvent입니다.
승인
이 메서드를 사용하는 스크립트에는 다음 범위 중 하나 이상 또는 관련 REST API의 적절한 범위에 대한 승인이 필요합니다.
-
https://www.googleapis.com/auth/calendar -
https://www.google.com/calendar/feeds
setVisibility(visibility)
이벤트의 공개 상태를 설정합니다.
매개변수
| 이름 | 유형 | 설명 |
|---|---|---|
visibility | Visibility |
리턴
CalendarEvent - 연결을 위한 CalendarEvent
승인
이 메서드를 사용하는 스크립트에는 다음 범위 중 하나 이상 또는 관련 REST API의 적절한 범위에 대한 승인이 필요합니다.
-
https://www.googleapis.com/auth/calendar -
https://www.google.com/calendar/feeds