Class CalendarEventSeries

CalendarEventSeries

مجموعه ای از رویدادها را نشان می دهد (یک رویداد تکرار شونده).

مواد و روش ها

روش نوع برگشت توضیح مختصر
addEmailReminder(minutesBefore) CalendarEventSeries یک یادآوری ایمیل جدید به رویداد اضافه می کند.
addGuest(email) CalendarEventSeries یک مهمان به رویداد اضافه می کند.
addPopupReminder(minutesBefore) CalendarEventSeries یک اعلان پاپ آپ جدید به رویداد اضافه می کند.
addSmsReminder(minutesBefore) CalendarEventSeries یک یادآور SMS جدید به رویداد اضافه می کند.
anyoneCanAddSelf() Boolean تعیین می کند که آیا افراد می توانند خود را به عنوان مهمان به یک رویداد تقویم اضافه کنند یا خیر.
deleteEventSeries() void مجموعه رویداد را حذف می کند.
deleteTag(key) CalendarEventSeries یک برچسب کلید/مقدار را از رویداد حذف می کند.
getAllTagKeys() String[] تمام کلیدهای برچسب هایی را که روی رویداد تنظیم شده اند دریافت می کند.
getColor() String رنگ رویداد تقویم را برمی‌گرداند.
getCreators() String[] سازندگان یک رویداد را دریافت می کند.
getDateCreated() Date تاریخ ایجاد رویداد را دریافت می کند.
getDescription() String شرح رویداد را دریافت می کند.
getEmailReminders() Integer[] مقادیر دقیقه را برای همه یادآوری‌های ایمیل رویداد دریافت می‌کند.
getGuestByEmail(email) EventGuest از طریق آدرس ایمیل یک مهمان می گیرد.
getGuestList() EventGuest[] مهمانان رویداد را می گیرد، بدون احتساب مالک رویداد.
getGuestList(includeOwner) EventGuest[] مهمانان رویداد، به طور بالقوه از جمله صاحبان رویداد را دریافت می کند.
getId() String iCalUID منحصر به فرد رویداد را دریافت می کند.
getLastUpdated() Date تاریخ آخرین به روز رسانی رویداد را دریافت می کند.
getLocation() String مکان رویداد را دریافت می کند.
getMyStatus() GuestStatus وضعیت رویداد (مانند حضور یا دعوت) کاربر مؤثر را دریافت می کند.
getOriginalCalendarId() String شناسه تقویمی که این رویداد در ابتدا در آنجا ایجاد شده است را دریافت کنید.
getPopupReminders() Integer[] مقادیر دقیقه را برای همه یادآورهای پاپ آپ رویداد دریافت می کند.
getSmsReminders() Integer[] مقادیر دقیقه را برای همه یادآورهای پیامک رویداد دریافت می کند.
getTag(key) String مقدار برچسب رویداد را دریافت می کند.
getTitle() String عنوان رویداد را دریافت می کند.
getVisibility() Visibility دید رویداد را دریافت می کند.
guestsCanInviteOthers() Boolean تعیین می کند که آیا مهمانان می توانند مهمانان دیگر را دعوت کنند یا خیر.
guestsCanModify() Boolean تعیین می کند که آیا مهمانان می توانند رویداد را تغییر دهند یا خیر.
guestsCanSeeGuests() Boolean تعیین می کند که آیا مهمانان می توانند مهمانان دیگر را ببینند یا خیر.
isOwnedByMe() Boolean تعیین می کند که آیا شما مالک رویداد هستید یا خیر.
removeAllReminders() CalendarEventSeries همه یادآوری ها را از رویداد حذف می کند.
removeGuest(email) CalendarEventSeries یک مهمان را از رویداد حذف می کند.
resetRemindersToDefault() CalendarEventSeries یادآوری ها را با استفاده از تنظیمات پیش فرض تقویم بازنشانی می کند.
setAnyoneCanAddSelf(anyoneCanAddSelf) CalendarEventSeries تعیین می‌کند که افراد غیرمهمان بتوانند خود را به رویداد اضافه کنند یا خیر.
setColor(color) CalendarEventSeries رنگ رویداد تقویم را تنظیم می کند.
setDescription(description) CalendarEventSeries شرح رویداد را تنظیم می کند.
setGuestsCanInviteOthers(guestsCanInviteOthers) CalendarEventSeries تعیین می کند که آیا مهمانان می توانند مهمانان دیگر را دعوت کنند یا خیر.
setGuestsCanModify(guestsCanModify) CalendarEventSeries تعیین می کند که آیا مهمانان می توانند رویداد را تغییر دهند یا خیر.
setGuestsCanSeeGuests(guestsCanSeeGuests) CalendarEventSeries تعیین می کند که آیا مهمانان می توانند مهمانان دیگر را ببینند یا خیر.
setLocation(location) CalendarEventSeries مکان رویداد را تنظیم می کند.
setMyStatus(status) CalendarEventSeries وضعیت رویداد (مانند حضور یا دعوت) کاربر مؤثر را تنظیم می کند.
setRecurrence(recurrence, startDate) CalendarEventSeries قوانین تکرار را برای مجموعه رویدادهای تمام روز تنظیم می کند.
setRecurrence(recurrence, startTime, endTime) CalendarEventSeries قوانین تکرار را برای این مجموعه رویداد تنظیم می کند.
setTag(key, value) CalendarEventSeries یک برچسب کلید/مقدار روی رویداد برای ذخیره ابرداده های سفارشی تنظیم می کند.
setTitle(title) CalendarEventSeries عنوان رویداد را تعیین می کند.
setVisibility(visibility) CalendarEventSeries نمایان بودن رویداد را تنظیم می کند.

مستندات دقیق

addEmailReminder(minutesBefore)

یک یادآوری ایمیل جدید به رویداد اضافه می کند. یادآوری باید حداقل 5 دقیقه و حداکثر 4 هفته (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 an email notification for 15 minutes before the event.
event.addEmailReminder(15);

مولفه های

نام تایپ کنید شرح
minutesBefore Integer تعداد دقیقه قبل از رویداد

برگشت

CalendarEventSeries - این CalendarEventSeries برای زنجیره زدن

پرتاب می کند

Error - اگر بیش از 5 یادآوری در مورد رویداد وجود داشته باشد یا زمان در محدوده قانونی نباشد

مجوز

اسکریپت هایی که از این روش استفاده می کنند نیاز به مجوز با یک یا چند مورد از حوزه های زیر یا محدوده های مناسب از REST API مربوطه دارند:

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

addGuest(email)

یک مهمان را به رویداد اضافه می کند.

// Example 1: Add a guest to one event
function addAttendeeToEvent() {
  // Replace the below values with your own
  let attendeeEmail = 'user@example.com'; // Email address of the person you need to add
  let calendarId = 'calendar_123@group.calendar.google.com'; // ID of calendar containing event
  let eventId = '123abc'; // ID of event instance

  let calendar = CalendarApp.getCalendarById(calendarId);
  if (calendar === null) {
    // Calendar not found
    console.log('Calendar not found', calendarId);
    return;
    }
  let event = calendar.getEventById(eventId);
  if (event === null) {
    // Event not found
    console.log('Event not found', eventId);
    return;
    }
  event.addGuest(attendeeEmail);
  }

// Example 2: Add a guest to all events on a calendar within a specified timeframe
function addAttendeeToAllEvents(){
// Replace the following values with your own
  let attendeeEmail = 'user@example.com'; // Email address of the person you need to add
  let calendarId = 'calendar_123@group.calendar.google.com'; // ID of calendar with the events
  let startDate = new Date("YYYY-MM-DD"); // The first date to add the guest to the events
  let endDate = new Date("YYYY-MM-DD"); // The last date to add the guest to the events

  let calendar = CalendarApp.getCalendarById(calendarId);
    if (calendar === null) {
    // Calendar not found
    console.log('Calendar not found', calendarId);
    return;
  }
  // Get the events within the specified timeframe
  let calEvents = calendar.getEvents(startDate,endDate);
  console.log(calEvents.length); // Checks how many events are found
  // Loop through all events and add the attendee to each of them
  for (var i = 0; i < calEvents.length; i++) {
  let event = calEvents[i];
  event.addGuest(attendeeEmail);
  }
}

مولفه های

نام تایپ کنید شرح
email String آدرس ایمیل مهمان.

برگشت

CalendarEventSeries - این CalendarEventSeries برای زنجیر کردن.

مجوز

اسکریپت هایی که از این روش استفاده می کنند نیاز به مجوز با یک یا چند مورد از حوزه های زیر یا محدوده های مناسب از 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);

مولفه های

نام تایپ کنید شرح
minutesBefore Integer تعداد دقیقه قبل از رویداد

برگشت

CalendarEventSeries - این CalendarEventSeries برای زنجیره زدن

مجوز

اسکریپت هایی که از این روش استفاده می کنند نیاز به مجوز با یک یا چند مورد از حوزه های زیر یا محدوده های مناسب از REST API مربوطه دارند:

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

addSmsReminder(minutesBefore)

یک یادآور SMS جدید به رویداد اضافه می کند. یادآوری باید حداقل 5 دقیقه و حداکثر 4 هفته (40320 دقیقه) قبل از رویداد باشد.

مولفه های

نام تایپ کنید شرح
minutesBefore Integer تعداد دقیقه قبل از رویداد

برگشت

CalendarEventSeries - این CalendarEventSeries برای زنجیره زدن

پرتاب می کند

Error - اگر بیش از 5 یادآوری در مورد رویداد وجود داشته باشد یا زمان در محدوده قانونی نباشد

مجوز

اسکریپت هایی که از این روش استفاده می کنند نیاز به مجوز با یک یا چند مورد از حوزه های زیر یا محدوده های مناسب از 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

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 - مهمان، یا اگر آدرس ایمیل با مهمان مطابقت نداشته باشد، خالی است

مجوز

اسکریپت هایی که از این روش استفاده می کنند نیاز به مجوز با یک یا چند مورد از حوزه های زیر یا محدوده های مناسب از 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());
}

مولفه های

نام تایپ کنید شرح
includeOwner 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 رویداد مورد استفاده توسط Calendar v3 API و Calendar advanced یکسان نیستند و نمی توان آنها را به جای هم استفاده کرد. یک تفاوت در معنایی آنها این است که در رویدادهای تکرار شونده، همه رخدادهای یک رویداد دارای 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@google.com');
// and replace the series ID with your own.
const event =
  calendar.getEvents(new Date('Jan 31, 2023 09:05:00'), new Date('Jan 31, 2023 09:15:00'))[0];

if (event) {
 // If an event exists within the given time frame, logs the title of the event.
 console.log(event.getTitle());
} else {
 // If no event exists within the given time frame, logs that information to the console.
 console.log('No events exist for the specified range');
}

برگشت

String - عنوان

مجوز

اسکریپت هایی که از این روش استفاده می کنند نیاز به مجوز با یک یا چند مورد از حوزه های زیر یا محدوده های مناسب از REST API مربوطه دارند:

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

getVisibility()

دید رویداد را دریافت می کند.

// Opens the calendar by its ID. You must have edit access to the calendar.
// TODO(developer): Replace the ID with your own.
const calendar = CalendarApp.getCalendarById('abc123456@group.calendar.google.com');

// Gets the first event from the calendar for February 1st, 2023 that takes place
// between 4:10 PM and 4:25 PM.
// For an event series, use calendar.getEventSeriesById('abc123456@google.com');
// and replace the series ID with your own.
const event =
  calendar.getEvents(new Date('Feb 01, 2023 16:10:00'), new Date('Feb 01, 2023 16:25:00'))[0];

if (event) {
 // If an event exists within the given time frame, gets the visibility of the event
 // and logs it.
 const eventVisibility = event.getVisibility();
 console.log(eventVisibility.toString());
} else {
 // If no event exists within the given time frame, logs that information to the console.
 console.log('No events exist for the specified range');
}

برگشت

Visibility - مقدار دید

مجوز

اسکریپت هایی که از این روش استفاده می کنند نیاز به مجوز با یک یا چند مورد از حوزه های زیر یا محدوده های مناسب از REST API مربوطه دارند:

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

guestsCanInviteOthers()

تعیین می کند که آیا مهمانان می توانند مهمانان دیگر را دعوت کنند یا خیر.

// Opens the calendar by its ID. You must have view access to the calendar.
// TODO(developer): Replace the ID with your own.
const calendar = CalendarApp.getCalendarById('abc123456@group.calendar.google.com');

// Gets the first event from the calendar for February 1st, 2023 that takes place
// between 9:35 AM and 9:40 AM.
// For an event series, use calendar.getEventSeriesById('abc123456@google.com');
// and replace the series ID with your own.
const event =
  calendar.getEvents(new Date('Feb 01, 2023 09:35:00'), new Date('Feb 01, 2023 09:40:00'))[0];

if (event) {
 // If an event exists within the given time frame, determines whether guests can invite
 // other guests and logs it.
 console.log(event.guestsCanInviteOthers());
} else {
 // If no event exists within the given time frame, logs that information to the console.
 console.log('No events exist for the specified range');
}

برگشت

Boolean - true اگر مهمانان بتوانند دیگران را دعوت کنند. false اگر نه

مجوز

اسکریپت هایی که از این روش استفاده می کنند نیاز به مجوز با یک یا چند مورد از حوزه های زیر یا محدوده های مناسب از REST API مربوطه دارند:

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

guestsCanModify()

تعیین می کند که آیا مهمانان می توانند رویداد را تغییر دهند یا خیر.

// Opens the calendar by its ID. You must have edit access to the calendar.
// TODO(developer): Replace the ID with your own.
const calendar = CalendarApp.getCalendarById('abc123456@group.calendar.google.com');

// Gets the first event from the calendar for February 1st, 2023 that takes place
// between 9:35 AM and 9:40 AM.
// For an event series, use calendar.getEventSeriesById('abc123456@google.com');
// and replace the series ID with your own.
const event =
  calendar.getEvents(new Date('Feb 01, 2023 09:35:00'), new Date('Feb 01, 2023 09:40:00'))[0];

if (event) {
 // If an event exists within the given time frame, sets the event so that guests can't
 // modify it.
 event.setGuestsCanModify(false);

 // Determines whether guests can modify the event and logs it.
 console.log(event.guestsCanModify());
} else {
 // If no event exists within the given time frame, logs that information to the console.
 console.log('No events exist for the specified range');
}

برگشت

Boolean - true اگر مهمانان بتوانند رویداد را تغییر دهند. false اگر نه

مجوز

اسکریپت هایی که از این روش استفاده می کنند نیاز به مجوز با یک یا چند مورد از حوزه های زیر یا محدوده های مناسب از REST API مربوطه دارند:

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

guestsCanSeeGuests()

تعیین می کند که آیا مهمانان می توانند مهمانان دیگر را ببینند یا خیر.

// Opens the calendar by its ID. You must have view access to the calendar.
// TODO(developer): Replace the ID with your own.
const calendar = CalendarApp.getCalendarById('abc123456@group.calendar.google.com');

// Gets the first event from the calendar for February 1st, 2023 that takes place
// between 9:35 AM and 9:40 AM.
// For an event series, use calendar.getEventSeriesById('abc123456@google.com');
// and replace the series ID with your own.
const event =
  calendar.getEvents(new Date('Feb 01, 2023 09:35:00'), new Date('Feb 01, 2023 09:40:00'))[0];

if (event) {
 // If an event exists within the given time frame, determines whether guests can see other
 // guests and logs it.
 console.log(event.guestsCanSeeGuests());
} else {
 // If no event exists within the given time frame, logs that information to the console.
 console.log('No events exist for the specified range');
}

برگشت

Boolean - اگر مهمانان بتوانند مهمانان دیگر را ببینند true . false اگر نه

مجوز

اسکریپت هایی که از این روش استفاده می کنند نیاز به مجوز با یک یا چند مورد از حوزه های زیر یا محدوده های مناسب از REST API مربوطه دارند:

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

isOwnedByMe()

تعیین می کند که آیا شما مالک رویداد هستید یا خیر.

// Opens the calendar by its ID. You must have view access to the calendar.
// TODO(developer): Replace the ID with your own.
const calendar = CalendarApp.getCalendarById('abc123456@group.calendar.google.com');

// Gets the first event from the calendar for January 31st, 2023 that takes place
// between 9:05 AM and 9:15 AM.
// For an event series, use calendar.getEventSeriesById('abc123456@google.com');
// and replace the series ID with your own.
const event =
  calendar.getEvents(new Date('Jan 31, 2023 09:05:00'), new Date('Jan 31, 2023 09:15:00'))[0];

if (event) {
 // If an event exists within the given time frame, determines whether you're the owner
 // of the event and logs it.
 console.log(event.isOwnedByMe());
} else {
 // If no event exists within the given time frame, logs that information to the console.
 console.log('No events exist for the specified range');
}

برگشت

Boolean - true اگر رویداد متعلق به کاربر مؤثر باشد. false اگر نه

مجوز

اسکریپت هایی که از این روش استفاده می کنند نیاز به مجوز با یک یا چند مورد از حوزه های زیر یا محدوده های مناسب از REST API مربوطه دارند:

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

removeAllReminders()

همه یادآوری ها را از رویداد حذف می کند.

// Opens the calendar by its ID. You must have edit access to the calendar
// TODO(developer): Replace the ID with your own.
const calendar = CalendarApp.getCalendarById('abc123456@group.calendar.google.com');

// Gets the first event from the calendar for February 1st, 2023 that takes place
// between 4:10 PM and 4:25 PM.
// For an event series, use calendar.getEventSeriesById('abc123456@google.com');
// and replace the series ID with your own.
const event =
  calendar.getEvents(new Date('Feb 1,2023 16:10:00'), new Date('Feb 1,2023 16:25:00'))[0];

if (event) {
 // If an event exists within the given time frame, removes all reminders from the event.
 event.removeAllReminders();
} else {
 // If no event exists within the given time frame, logs that information to the console.
 console.log('No events exist for the specified range');
}

برگشت

CalendarEventSeries - این CalendarEventSeries برای زنجیره زدن

مجوز

اسکریپت هایی که از این روش استفاده می کنند نیاز به مجوز با یک یا چند مورد از حوزه های زیر یا محدوده های مناسب از REST API مربوطه دارند:

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

removeGuest(email)

یک مهمان را از رویداد حذف می کند.

// Example 1: Remove a guest from one event
function removeGuestFromEvent() {
  // Replace the below values with your own
  let attendeeEmail = 'user@example.com'; // Email address of the person you need to remove
  let calendarId = 'calendar_123@group.calendar.google.com'; // ID of calendar containing event
  let eventId = '123abc'; // ID of event instance

  let calendar = CalendarApp.getCalendarById(calendarId);
  if (calendar === null) {
    // Calendar not found
    console.log('Calendar not found', calendarId);
    return;
    }
  let event = calendar.getEventById(eventId);
  if (event === null) {
    // Event not found
    console.log('Event not found', eventId);
    return;
    }
  event.removeGuest(attendeeEmail);
  }

// Example 2: Remove a guest from all events on a calendar within a specified timeframe
function removeGuestFromAllEvents(){
// Replace the following values with your own
  let attendeeEmail = 'user@example.com'; // Email address of the person you need to remove
  let calendarId = 'calendar_123@group.calendar.google.com'; // ID of calendar with the events
  let startDate = new Date("YYYY-MM-DD"); // The first date to remove the guest from the events
  let endDate = new Date("YYYY-MM-DD"); // The last date to remove the attendee from the events

  let calendar = CalendarApp.getCalendarById(calendarId);
    if (calendar === null) {
    // Calendar not found
    console.log('Calendar not found', calendarId);
    return;
  }
  // Get the events within the specified timeframe
  let calEvents = calendar.getEvents(startDate,endDate);
  console.log(calEvents.length); // Checks how many events are found
  // Loop through all events and remove the attendee from each of them
  for (var i = 0; i < calEvents.length; i++) {
  let event = calEvents[i];
  event.removeGuest(attendeeEmail);
  }
}

مولفه های

نام تایپ کنید شرح
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');
}

مولفه های

نام تایپ کنید شرح
anyoneCanAddSelf 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 یک فهرست رنگ عدد صحیح به عنوان یک رشته، یا یک مقدار از CalendarApp.EventColor .

برگشت

CalendarEventSeries - این رویداد تقویم، برای زنجیره زدن.

مجوز

اسکریپت هایی که از این روش استفاده می کنند نیاز به مجوز با یک یا چند مورد از حوزه های زیر یا محدوده های مناسب از REST API مربوطه دارند:

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

setDescription(description)

شرح رویداد را تنظیم می کند.

// Opens the calendar by its ID. You must have edit access to the calendar.
// TODO(developer): Replace the ID with your own.
const calendar = CalendarApp.getCalendarById('abc123456@group.calendar.google.com');

// Gets the first event from the calendar for February 4th, 2023 that takes place
// between 5:05 PM and 5:35 PM.
// For an event series, use calendar.getEventSeriesById('abc123456@google.com');
// and replace the series ID with your own.
const event =
  calendar.getEvents(new Date('Feb 04, 2023 17:05:00'), new Date('Feb 04, 2023 17:35:00'))[0];

if (event) {
 // If an event exists within the given time frame, sets the description of the event to
 // 'Meeting.'
 event.setDescription('Meeting');
} else {
 // If no event exists within the given time frame, logs that information to the console.
 console.log('No events exist for the specified range');
}

مولفه های

نام تایپ کنید شرح
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');
}

مولفه های

نام تایپ کنید شرح
guestsCanInviteOthers Boolean آیا مهمانان می توانند دیگران را دعوت کنند

برگشت

CalendarEventSeries - این CalendarEventSeries برای زنجیره زدن

مجوز

اسکریپت هایی که از این روش استفاده می کنند نیاز به مجوز با یک یا چند مورد از حوزه های زیر یا محدوده های مناسب از REST API مربوطه دارند:

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

setGuestsCanModify(guestsCanModify)

تعیین می کند که آیا مهمانان می توانند رویداد را تغییر دهند یا خیر.

مولفه های

نام تایپ کنید شرح
guestsCanModify Boolean آیا مهمانان می توانند رویداد را تغییر دهند

برگشت

CalendarEventSeries - این CalendarEventSeries برای زنجیره زدن

مجوز

اسکریپت هایی که از این روش استفاده می کنند نیاز به مجوز با یک یا چند مورد از حوزه های زیر یا محدوده های مناسب از REST API مربوطه دارند:

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

setGuestsCanSeeGuests(guestsCanSeeGuests)

تعیین می کند که آیا مهمانان می توانند مهمانان دیگر را ببینند یا خیر.

مولفه های

نام تایپ کنید شرح
guestsCanSeeGuests 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 GuestStatus وضعیت جدید

برگشت

CalendarEventSeries - این CalendarEventSeries برای زنجیره زدن

مجوز

اسکریپت هایی که از این روش استفاده می کنند نیاز به مجوز با یک یا چند مورد از حوزه های زیر یا محدوده های مناسب از REST API مربوطه دارند:

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

setRecurrence(recurrence, startDate)

قوانین تکرار را برای مجموعه رویدادهای تمام روز تنظیم می کند. اعمال این روش یک سری رویداد معمولی را به یک مجموعه رویداد تمام روز تبدیل می کند.

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

مولفه های

نام تایپ کنید شرح
recurrence EventRecurrence قوانین عود برای استفاده
startDate 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.
var eventSeries = CalendarApp.getDefaultCalendar().getEventSeriesById('123456789@google.com');
var startTime = new Date('January 1, 2013 03:00:00 PM EST');
var endTime = new Date('January 1, 2013 04:00:00 PM EST');
var recurrence = CalendarApp.newRecurrence().addWeeklyRule()
     .onlyOnWeekdays([CalendarApp.Weekday.TUESDAY, CalendarApp.Weekday.THURSDAY])
     .until(new Date('January 1, 2014'));
eventSeries.setRecurrence(recurrence, startTime, endTime);

مولفه های

نام تایپ کنید شرح
recurrence EventRecurrence قوانین عود برای استفاده
startTime Date تاریخ و زمانی که اولین رویداد در مجموعه شروع می شود
endTime 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@google.com');
// and replace the series ID with your own.
const event =
  calendar.getEvents(new Date('Jan 31, 2023 09:05:00'), new Date('Jan 31, 2023 09:15:00'))[0];

if (event) {
 // If an event exists within the given time frame, changes its title to Event1.
 event.setTitle('Event1');
} else {
 // If no event exists within the given time frame, logs that information to the console.
 console.log('No events exist for the specified range');
}

مولفه های

نام تایپ کنید شرح
title String عنوان جدید

برگشت

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