نشان دهنده یک سری از رویدادها (یک رویداد تکرارشونده) است.
روشها
| روش | نوع بازگشتی | شرح مختصر |
|---|---|---|
add Email Reminder(minutesBefore) | Calendar Event Series | یک یادآوری ایمیل جدید به رویداد اضافه میکند. |
add Guest(email) | Calendar Event Series | یک مهمان به رویداد اضافه میکند. |
add Popup Reminder(minutesBefore) | Calendar Event Series | یک اعلان پاپآپ جدید به رویداد اضافه میکند. |
add Sms Reminder(minutesBefore) | Calendar Event Series | یک یادآوری پیامکی جدید به رویداد اضافه میکند. |
anyone Can Add Self() | Boolean | تعیین میکند که آیا افراد میتوانند خود را به عنوان مهمان به یک رویداد تقویم اضافه کنند یا خیر. |
delete Event Series() | void | مجموعه رویدادها را حذف میکند. |
delete Tag(key) | Calendar Event Series | یک برچسب کلید/مقدار را از رویداد حذف میکند. |
get All Tag Keys() | String[] | تمام کلیدهای مربوط به تگهایی که روی رویداد تنظیم شدهاند را دریافت میکند. |
get Color() | String | رنگ رویداد تقویم را برمیگرداند. |
get Creators() | String[] | سازندگان یک رویداد را پیدا میکند. |
get Date Created() | Date | تاریخ ایجاد رویداد را دریافت میکند. |
get Description() | String | شرح رویداد را دریافت میکند. |
get Email Reminders() | Integer[] | مقادیر دقیقه را برای همه یادآوریهای ایمیلی مربوط به رویداد دریافت میکند. |
get Event Type() | Event Type | Event Type این رویداد را دریافت میکند. |
get Guest By Email(email) | Event Guest | از طریق آدرس ایمیل مهمان دریافت میکند. |
get Guest List() | Event Guest[] | مهمانان رویداد را انتخاب میکند، به جز صاحب رویداد. |
get Guest List(includeOwner) | Event Guest[] | مهمانان رویداد، از جمله صاحبان رویداد، را انتخاب میکند. |
get Id() | String | iCalUID منحصر به فرد رویداد را دریافت میکند. |
get Last Updated() | Date | تاریخ آخرین بهروزرسانی رویداد را دریافت میکند. |
get Location() | String | مکان رویداد را دریافت میکند. |
get My Status() | Guest Status | وضعیت رویداد (مانند شرکتکننده یا دعوتشده) کاربر مؤثر را دریافت میکند. |
get Original Calendar Id() | String | شناسه تقویمی را که این رویداد در ابتدا در آن ایجاد شده است، دریافت کنید. |
get Popup Reminders() | Integer[] | مقادیر دقیقه را برای همه یادآوریهای پاپآپ برای رویداد دریافت میکند. |
get Sms Reminders() | Integer[] | مقادیر دقیقه را برای همه یادآوریهای پیامکی مربوط به رویداد دریافت میکند. |
get Tag(key) | String | مقدار برچسب رویداد را دریافت میکند. |
get Title() | String | عنوان رویداد را به خود اختصاص میدهد. |
get Transparency() | Event Transparency | شفافیت رویداد را به دست میآورد. |
get Visibility() | Visibility | قابلیت مشاهده رویداد را پیدا میکند. |
guests Can Invite Others() | Boolean | مشخص میکند که آیا مهمانان میتوانند مهمانان دیگری را دعوت کنند یا خیر. |
guests Can Modify() | Boolean | تعیین میکند که آیا مهمانان میتوانند رویداد را تغییر دهند یا خیر. |
guests Can See Guests() | Boolean | تعیین میکند که آیا مهمانان میتوانند مهمانان دیگر را ببینند یا خیر. |
is Owned By Me() | Boolean | مشخص میکند که آیا شما مالک رویداد هستید یا خیر. |
remove All Reminders() | Calendar Event Series | تمام یادآوریهای رویداد را حذف میکند. |
remove Guest(email) | Calendar Event Series | مهمان را از رویداد حذف میکند. |
reset Reminders To Default() | Calendar Event Series | یادآوریها را با استفاده از تنظیمات پیشفرض تقویم، مجدداً تنظیم میکند. |
set Anyone Can Add Self(anyoneCanAddSelf) | Calendar Event Series | تعیین میکند که آیا افراد غیر مهمان میتوانند خود را به رویداد اضافه کنند یا خیر. |
set Color(color) | Calendar Event Series | رنگ رویداد تقویم را تنظیم میکند. |
set Description(description) | Calendar Event Series | شرح رویداد را تنظیم میکند. |
set Guests Can Invite Others(guestsCanInviteOthers) | Calendar Event Series | تنظیم میکند که آیا مهمانان میتوانند مهمانان دیگر را دعوت کنند یا خیر. |
set Guests Can Modify(guestsCanModify) | Calendar Event Series | تعیین میکند که آیا مهمانان میتوانند رویداد را تغییر دهند یا خیر. |
set Guests Can See Guests(guestsCanSeeGuests) | Calendar Event Series | تنظیم میکند که آیا مهمانان میتوانند مهمانان دیگر را ببینند یا خیر. |
set Location(location) | Calendar Event Series | مکان رویداد را تعیین میکند. |
set My Status(status) | Calendar Event Series | وضعیت رویداد (مانند شرکت کردن یا دعوت شدن) کاربر مؤثر را تنظیم میکند. |
set Recurrence(recurrence, startDate) | Calendar Event Series | قوانین تکرار را برای یک سری رویدادهای تمام روز تنظیم میکند. |
set Recurrence(recurrence, startTime, endTime) | Calendar Event Series | قوانین تکرار را برای این سری رویدادها تنظیم میکند. |
set Tag(key, value) | Calendar Event Series | یک برچسب کلید/مقدار برای رویداد، برای ذخیره ابردادههای سفارشی، تنظیم میکند. |
set Title(title) | Calendar Event Series | عنوان رویداد را تنظیم میکند. |
set Transparency(transparency) | Calendar Event Series | شفافیت رویداد را تنظیم میکند. |
set Visibility(visibility) | Calendar Event Series | میزان دیده شدن رویداد را تنظیم میکند. |
مستندات دقیق
addEmailReminder(minutesBefore)
یک یادآوری ایمیل جدید به رویداد اضافه میکند. یادآوری باید حداقل ۵ دقیقه و حداکثر ۴ هفته (۴۰۳۲۰ دقیقه) قبل از رویداد باشد.
// 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 Before | Integer | تعداد دقایق قبل از رویداد |
بازگشت
CalendarEventSeries — این CalendarEventSeries برای زنجیرهسازی
پرتابها
Error — اگر بیش از ۵ یادآوری برای رویداد وجود داشته باشد یا زمان در محدوده قانونی نباشد
مجوز
اسکریپتهایی که از این روش استفاده میکنند، نیاز به مجوز با یک یا چند مورد از حوزههای زیر یا حوزههای مناسب از 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 | آدرس ایمیل مهمان. |
بازگشت
CalendarEventSeries — این CalendarEventSeries برای زنجیرهسازی است.
مجوز
اسکریپتهایی که از این روش استفاده میکنند، نیاز به مجوز با یک یا چند مورد از حوزههای زیر یا حوزههای مناسب از REST API مرتبط دارند:
-
https://www.googleapis.com/auth/calendar -
https://www.google.com/calendar/feeds
addPopupReminder(minutesBefore)
یک اعلان پاپآپ جدید به رویداد اضافه میکند. این اعلان باید حداقل ۵ دقیقه و حداکثر ۴ هفته (۴۰۳۲۰ دقیقه) قبل از رویداد باشد.
// 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 Before | Integer | تعداد دقایق قبل از رویداد |
بازگشت
CalendarEventSeries — این CalendarEventSeries برای زنجیرهسازی
مجوز
اسکریپتهایی که از این روش استفاده میکنند، نیاز به مجوز با یک یا چند مورد از حوزههای زیر یا حوزههای مناسب از REST API مرتبط دارند:
-
https://www.googleapis.com/auth/calendar -
https://www.google.com/calendar/feeds
addSmsReminder(minutesBefore)
یک یادآوری پیامکی جدید به رویداد اضافه میکند. یادآوری باید حداقل ۵ دقیقه و حداکثر ۴ هفته (۴۰۳۲۰ دقیقه) قبل از رویداد باشد.
پارامترها
| نام | نوع | توضیحات |
|---|---|---|
minutes Before | Integer | تعداد دقایق قبل از رویداد |
بازگشت
CalendarEventSeries — این CalendarEventSeries برای زنجیرهسازی
پرتابها
Error — اگر بیش از ۵ یادآوری برای رویداد وجود داشته باشد یا زمان در محدوده قانونی نباشد
مجوز
اسکریپتهایی که از این روش استفاده میکنند، نیاز به مجوز با یک یا چند مورد از حوزههای زیر یا حوزههای مناسب از REST API مرتبط دارند:
-
https://www.googleapis.com/auth/calendar -
https://www.google.com/calendar/feeds
anyoneCanAddSelf()
تعیین میکند که آیا افراد میتوانند خود را به عنوان مهمان به یک رویداد تقویم اضافه کنند یا خیر.
// Gets an event by its ID. For an event series, use getEventSeriesById(iCalId) // instead. // TODO(developer): Replace the string with the event ID that you want to get. const event = CalendarApp.getEventById('abc123456'); // Determines whether people can add themselves as guests to the event and logs // it. console.log(event.anyoneCanAddSelf());
بازگشت
Boolean - اگر افراد غیر مهمان بتوانند خود را به رویداد اضافه کنند، true و در غیر این صورت false برمیگرداند.
مجوز
اسکریپتهایی که از این روش استفاده میکنند، نیاز به مجوز با یک یا چند مورد از حوزههای زیر یا حوزههای مناسب از 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)
یک برچسب کلید/مقدار را از رویداد حذف میکند.
پارامترها
| نام | نوع | توضیحات |
|---|---|---|
key | String | کلید برچسب |
بازگشت
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 - نمایش رشتهای رنگ رویداد، به عنوان یک اندیس (1-11) از مقادیر CalendarApp.EventColor .
مجوز
اسکریپتهایی که از این روش استفاده میکنند، نیاز به مجوز با یک یا چند مورد از حوزههای زیر یا حوزههای مناسب از 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
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 Owner | 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 منحصر به فرد رویداد را دریافت میکند. توجه داشته باشید که iCalUID و id رویداد مورد استفاده توسط API تقویم نسخه ۳ و سرویس پیشرفته تقویم یکسان نیستند و نمیتوان آنها را به جای یکدیگر استفاده کرد. یک تفاوت در معنای آنها این است که در رویدادهای تکرارشونده، همه رویدادهای یک رویداد 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()
شناسه تقویمی را که این رویداد در ابتدا در آن ایجاد شده است، دریافت کنید.
// 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 - شناسه تقویم اصلی
مجوز
اسکریپتهایی که از این روش استفاده میکنند، نیاز به مجوز با یک یا چند مورد از حوزههای زیر یا حوزههای مناسب از 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()
مقادیر دقیقه را برای همه یادآوریهای پیامکی مربوط به رویداد دریافت میکند.
بازگشت
Integer[] - آرایهای که در آن هر مقدار مربوط به تعداد دقایق قبل از رویدادی است که یادآوری آن را فعال میکند.
مجوز
اسکریپتهایی که از این روش استفاده میکنند، نیاز به مجوز با یک یا چند مورد از حوزههای زیر یا حوزههای مناسب از 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 است، به این معنی که تقویم در آن زمان به صورت Available (موجود) نشان داده میشود، یا OPAQUE ، به این معنی که تقویم در آن زمان به صورت Busy (مشغول) نشان داده میشود، استفاده کنید.
// 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
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 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 | آدرس ایمیل مهمان |
بازگشت
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'); }
پارامترها
| نام | نوع | توضیحات |
|---|---|---|
anyone Can Add Self | Boolean | آیا کسی میتواند خودش را دعوت کند؟ |
بازگشت
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'); }
پارامترها
| نام | نوع | توضیحات |
|---|---|---|
color | String | یک اندیس رنگ عدد صحیح به عنوان یک رشته، یا یک مقدار از Calendar App.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'); }
پارامترها
| نام | نوع | توضیحات |
|---|---|---|
description | String | توضیحات جدید |
بازگشت
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'); }
پارامترها
| نام | نوع | توضیحات |
|---|---|---|
guests Can Invite Others | Boolean | آیا مهمانان میتوانند دیگران را دعوت کنند؟ |
بازگشت
CalendarEventSeries — این CalendarEventSeries برای زنجیرهسازی
مجوز
اسکریپتهایی که از این روش استفاده میکنند، نیاز به مجوز با یک یا چند مورد از حوزههای زیر یا حوزههای مناسب از REST API مرتبط دارند:
-
https://www.googleapis.com/auth/calendar -
https://www.google.com/calendar/feeds
setGuestsCanModify(guestsCanModify)
تعیین میکند که آیا مهمانان میتوانند رویداد را تغییر دهند یا خیر.
پارامترها
| نام | نوع | توضیحات |
|---|---|---|
guests Can Modify | Boolean | آیا مهمانان میتوانند رویداد را تغییر دهند؟ |
بازگشت
CalendarEventSeries — این CalendarEventSeries برای زنجیرهسازی
مجوز
اسکریپتهایی که از این روش استفاده میکنند، نیاز به مجوز با یک یا چند مورد از حوزههای زیر یا حوزههای مناسب از REST API مرتبط دارند:
-
https://www.googleapis.com/auth/calendar -
https://www.google.com/calendar/feeds
setGuestsCanSeeGuests(guestsCanSeeGuests)
تنظیم میکند که آیا مهمانان میتوانند مهمانان دیگر را ببینند یا خیر.
پارامترها
| نام | نوع | توضیحات |
|---|---|---|
guests Can See Guests | Boolean | آیا مهمانان میتوانند دیگران را ببینند؟ |
بازگشت
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'); }
پارامترها
| نام | نوع | توضیحات |
|---|---|---|
location | String | مکان جدید |
بازگشت
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'); }
پارامترها
| نام | نوع | توضیحات |
|---|---|---|
status | Guest Status | وضعیت جدید |
بازگشت
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. const eventSeries = CalendarApp.getDefaultCalendar().getEventSeriesById( '123456789@example.com', ); const startDate = new Date('January 2, 2013 03:00:00 PM EST'); const recurrence = CalendarApp.newRecurrence() .addWeeklyRule() .onlyOnWeekday(CalendarApp.Weekday.WEDNESDAY) .until(new Date('January 1, 2014')); eventSeries.setRecurrence(recurrence, startDate);
پارامترها
| نام | نوع | توضیحات |
|---|---|---|
recurrence | Event Recurrence | قوانین تکرار برای استفاده |
start Date | Date | تاریخ اولین رویداد در این مجموعه (فقط روز استفاده میشود؛ زمان نادیده گرفته میشود) |
بازگشت
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. const eventSeries = CalendarApp.getDefaultCalendar().getEventSeriesById( '123456789@example.com', ); const startTime = new Date('January 1, 2013 03:00:00 PM EST'); const endTime = new Date('January 1, 2013 04:00:00 PM EST'); const recurrence = CalendarApp.newRecurrence() .addWeeklyRule() .onlyOnWeekdays( [CalendarApp.Weekday.TUESDAY, CalendarApp.Weekday.THURSDAY]) .until(new Date('January 1, 2014')); eventSeries.setRecurrence(recurrence, startTime, endTime);
پارامترها
| نام | نوع | توضیحات |
|---|---|---|
recurrence | Event Recurrence | قوانین تکرار برای استفاده |
start Time | Date | تاریخ و زمان شروع اولین رویداد در این مجموعه |
end Time | Date | تاریخ و زمان پایان اولین رویداد در این مجموعه |
بازگشت
CalendarEventSeries — این CalendarEventSeries برای زنجیرهسازی
مجوز
اسکریپتهایی که از این روش استفاده میکنند، نیاز به مجوز با یک یا چند مورد از حوزههای زیر یا حوزههای مناسب از REST API مرتبط دارند:
-
https://www.googleapis.com/auth/calendar -
https://www.google.com/calendar/feeds
setTag(key, value)
یک برچسب کلید/مقدار برای رویداد، برای ذخیره ابردادههای سفارشی، تنظیم میکند.
پارامترها
| نام | نوع | توضیحات |
|---|---|---|
key | String | کلید برچسب |
value | String | مقدار برچسب |
بازگشت
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@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 | عنوان جدید |
بازگشت
CalendarEventSeries — این CalendarEventSeries برای زنجیرهسازی
مجوز
اسکریپتهایی که از این روش استفاده میکنند، نیاز به مجوز با یک یا چند مورد از حوزههای زیر یا حوزههای مناسب از REST API مرتبط دارند:
-
https://www.googleapis.com/auth/calendar -
https://www.google.com/calendar/feeds
setTransparency(transparency)
شفافیت رویداد را تنظیم میکند. از این متد برای تنظیم اینکه آیا یک رویداد TRANSPARENT باشد، به این معنی که تقویم در آن زمان به صورت Available (موجود) نشان داده شود، یا OPAQUE ، به این معنی که تقویم در آن زمان به صورت Busy (مشغول) نشان داده شود، استفاده کنید.
// 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 Transparency | ارزش شفافیت. |
بازگشت
CalendarEventSeries — این CalendarEventSeries برای زنجیرهسازی است.
مجوز
اسکریپتهایی که از این روش استفاده میکنند، نیاز به مجوز با یک یا چند مورد از حوزههای زیر یا حوزههای مناسب از REST API مرتبط دارند:
-
https://www.googleapis.com/auth/calendar -
https://www.google.com/calendar/feeds
setVisibility(visibility)
میزان دیده شدن رویداد را تنظیم میکند.
پارامترها
| نام | نوع | توضیحات |
|---|---|---|
visibility | Visibility |
بازگشت
CalendarEventSeries — این CalendarEventSeries برای زنجیرهسازی
مجوز
اسکریپتهایی که از این روش استفاده میکنند، نیاز به مجوز با یک یا چند مورد از حوزههای زیر یا حوزههای مناسب از REST API مرتبط دارند:
-
https://www.googleapis.com/auth/calendar -
https://www.google.com/calendar/feeds