Class CalendarEvent

CalendarEvent

यह एक कैलेंडर इवेंट के बारे में बताता है.

तरीके

तरीकारिटर्न टाइपसंक्षिप्त विवरण
addEmailReminder(minutesBefore)CalendarEventइवेंट में एक नया ईमेल रिमाइंडर जोड़ता है.
addGuest(email)CalendarEventइवेंट में मेहमान को जोड़ता है.
addPopupReminder(minutesBefore)CalendarEventइवेंट में एक नई पॉप-अप सूचना जोड़ता है.
addSmsReminder(minutesBefore)CalendarEventइवेंट में एक नया एसएमएस रिमाइंडर जोड़ता है.
anyoneCanAddSelf()Booleanइससे यह तय होता है कि लोग कैलेंडर इवेंट में खुद को मेहमान के रूप में जोड़ सकते हैं या नहीं.
deleteEvent()voidकैलेंडर इवेंट को मिटाता है.
deleteTag(key)CalendarEventइवेंट से कुंजी/वैल्यू टैग मिटाता है.
getAllDayEndDate()Dateपूरे दिन के इस कैलेंडर इवेंट के खत्म होने की तारीख का पता चलता है.
getAllDayStartDate()Dateपूरे दिन के इस कैलेंडर इवेंट के शुरू होने की तारीख का पता चलता है.
getAllTagKeys()String[]इवेंट पर सेट किए गए टैग की सभी कुंजियां मिलती हैं.
getColor()Stringकैलेंडर इवेंट का रंग दिखाता है.
getCreators()String[]किसी इवेंट के क्रिएटर की जानकारी मिलती है.
getDateCreated()Dateइवेंट बनाने की तारीख का पता चलता है.
getDescription()Stringइवेंट की जानकारी मिलती है.
getEmailReminders()Integer[]इवेंट के लिए सभी ईमेल रिमाइंडर के लिए मिनट की वैल्यू दिखाता है.
getEndTime()Dateकैलेंडर इवेंट के खत्म होने की तारीख और समय की जानकारी मिलती है.
getEventSeries()CalendarEventSeriesइस इवेंट से जुड़े बार-बार होने वाले इवेंट की सीरीज़ पाएं.
getGuestByEmail(email)EventGuestईमेल पते से मेहमान को कॉल करता है.
getGuestList()EventGuest[]इवेंट के मेहमानों को शामिल करता है, जिसमें इवेंट का मालिक शामिल नहीं होता.
getGuestList(includeOwner)EventGuest[]इवेंट के मेहमानों को शामिल करता है. इनमें इवेंट के मालिक भी शामिल हो सकते हैं.
getId()Stringइवेंट का यूनीक iCalUID की जानकारी मिलती है.
getLastUpdated()Dateउस तारीख की जानकारी मिलती है जिस दिन इवेंट को आखिरी बार अपडेट किया गया था.
getLocation()Stringइवेंट की जगह की जानकारी मिलती है.
getMyStatus()GuestStatusअसरदार उपयोगकर्ता के इवेंट की स्थिति की जानकारी मिलती है. जैसे, इवेंट में शामिल होना या उसे न्योता भेजना.
getOriginalCalendarId()Stringउस कैलेंडर का आईडी पाएं जहां से यह इवेंट मूल रूप से बनाया गया था.
getPopupReminders()Integer[]इवेंट के लिए सभी पॉप-अप रिमाइंडर के लिए मिनट की वैल्यू दिखाता है.
getSmsReminders()Integer[]इवेंट के लिए सभी एसएमएस रिमाइंडर के लिए मिनट की वैल्यू दिखाता है.
getStartTime()Dateकैलेंडर इवेंट के शुरू होने की तारीख और समय की जानकारी मिलती है.
getTag(key)Stringइवेंट की टैग वैल्यू दिखाता है.
getTitle()Stringइवेंट के शीर्षक की जानकारी मिलती है.
getVisibility()Visibilityइवेंट किसे दिखे, इस बारे में जानकारी मिलती है.
guestsCanInviteOthers()Booleanइससे तय होता है कि मेहमान दूसरे मेहमानों को न्योता भेज सकते हैं या नहीं.
guestsCanModify()Booleanइससे यह तय किया जाता है कि मेहमान इवेंट में बदलाव कर सकते हैं या नहीं.
guestsCanSeeGuests()Booleanइससे तय होता है कि मेहमान अन्य मेहमानों को देख सकते हैं या नहीं.
isAllDayEvent()Booleanइससे पता चलता है कि यह पूरे दिन का इवेंट है या नहीं.
isOwnedByMe()Booleanइससे यह पता चलता है कि आप इवेंट के मालिक हैं या नहीं.
isRecurringEvent()Booleanयह तय करता है कि इवेंट किसी इवेंट सीरीज़ का हिस्सा है या नहीं.
removeAllReminders()CalendarEventइवेंट के सभी रिमाइंडर हटा देता है.
removeGuest(email)CalendarEventइवेंट से मेहमान को हटाता है.
resetRemindersToDefault()CalendarEventकैलेंडर की डिफ़ॉल्ट सेटिंग का इस्तेमाल करके रिमाइंडर रीसेट करता है.
setAllDayDate(date)CalendarEventइवेंट की तारीख सेट करता है.
setAllDayDates(startDate, endDate)CalendarEventइवेंट की तारीखें सेट करता है.
setAnyoneCanAddSelf(anyoneCanAddSelf)CalendarEventसेट करता है कि गैर-मेहमान खुद को इवेंट में जोड़ सकते हैं या नहीं.
setColor(color)CalendarEventकैलेंडर इवेंट का रंग सेट करता है.
setDescription(description)CalendarEventइवेंट की जानकारी सेट करता है.
setGuestsCanInviteOthers(guestsCanInviteOthers)CalendarEventसेट करता है कि मेहमान अन्य मेहमानों को न्योता भेज सकते हैं या नहीं.
setGuestsCanModify(guestsCanModify)CalendarEventसेट करता है कि मेहमान इवेंट में बदलाव कर सकते हैं या नहीं.
setGuestsCanSeeGuests(guestsCanSeeGuests)CalendarEventसेट करता है कि क्या मेहमान अन्य मेहमानों को देख सकते हैं.
setLocation(location)CalendarEventइवेंट की जगह सेट करता है.
setMyStatus(status)CalendarEventअसरदार उपयोगकर्ता के इवेंट की स्थिति सेट करती है, जैसे कि इवेंट में शामिल होना या उसे न्योता भेजना.
setTag(key, value)CalendarEventकस्टम मेटाडेटा को सेव करने के लिए, इवेंट पर कुंजी/वैल्यू टैग सेट करता है.
setTime(startTime, endTime)CalendarEventइवेंट के शुरू और खत्म होने की तारीख और समय सेट करता है.
setTitle(title)CalendarEventइवेंट का शीर्षक सेट करता है.
setVisibility(visibility)CalendarEventइवेंट की दृश्यता सेट करता है.

ज़्यादा जानकारी के साथ दस्तावेज़

addEmailReminder(minutesBefore)

इवेंट में एक नया ईमेल रिमाइंडर जोड़ता है. रिमाइंडर, इवेंट से कम से कम पांच मिनट पहले और ज़्यादा से ज़्यादा चार हफ़्ते (40,320 मिनट) का होना चाहिए.

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

// Adds an email notification for 15 minutes before the event.
event.addEmailReminder(15);

पैरामीटर

नामTypeब्यौरा
minutesBeforeIntegerइवेंट शुरू होने के कुल मिनट

रिटर्न

CalendarEvent — यह CalendarEvent चेन बनाने के लिए है

थ्रो

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
  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);
  }
}

पैरामीटर

नामTypeब्यौरा
emailStringमेहमान का ईमेल पता.

रिटर्न

CalendarEvent — यह CalendarEvent चेन बनाने के लिए है.

अनुमति देना

इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट को, इनमें से एक या उससे ज़्यादा स्कोप या मिलते-जुलते REST API के सही स्कोप की मदद से अनुमति देना ज़रूरी होता है:

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

addPopupReminder(minutesBefore)

इवेंट में एक नई पॉप-अप सूचना जोड़ता है. सूचना, इवेंट से कम से कम पांच मिनट पहले और ज़्यादा से ज़्यादा चार हफ़्ते (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);

पैरामीटर

नामTypeब्यौरा
minutesBeforeIntegerइवेंट शुरू होने के कुल मिनट

रिटर्न

CalendarEvent — यह CalendarEvent चेन बनाने के लिए है

अनुमति देना

इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट को, इनमें से एक या उससे ज़्यादा स्कोप या मिलते-जुलते REST API के सही स्कोप की मदद से अनुमति देना ज़रूरी होता है:

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

addSmsReminder(minutesBefore)

इवेंट में एक नया एसएमएस रिमाइंडर जोड़ता है. रिमाइंडर, इवेंट से कम से कम पांच मिनट पहले और ज़्यादा से ज़्यादा चार हफ़्ते (40,320 मिनट) का होना चाहिए.

पैरामीटर

नामTypeब्यौरा
minutesBeforeIntegerइवेंट शुरू होने के कुल मिनट

रिटर्न

CalendarEvent — यह CalendarEvent चेन बनाने के लिए है

थ्रो

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());

रिटर्न

Booleantrue अगर मेहमान नहीं हैं, तो वे खुद को इवेंट में जोड़ सकते हैं. अगर ऐसा नहीं है, तो false

अनुमति देना

इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट को, इनमें से एक या उससे ज़्यादा स्कोप या मिलते-जुलते REST API के सही स्कोप की मदद से अनुमति देना ज़रूरी होता है:

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

deleteEvent()

कैलेंडर इवेंट को मिटाता है.

// Gets an event by its ID.
// TODO(developer): Replace the string with the ID of the event that you want to delete.
const event = CalendarApp.getEventById('abc123456');

// Deletes the event.
event.deleteEvent();

अनुमति देना

इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट को, इनमें से एक या उससे ज़्यादा स्कोप या मिलते-जुलते REST API के सही स्कोप की मदद से अनुमति देना ज़रूरी होता है:

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

deleteTag(key)

इवेंट से कुंजी/वैल्यू टैग मिटाता है.

पैरामीटर

नामTypeब्यौरा
keyStringटैग कुंजी

रिटर्न

CalendarEvent — यह CalendarEvent चेन बनाने के लिए है

अनुमति देना

इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट को, इनमें से एक या उससे ज़्यादा स्कोप या मिलते-जुलते REST API के सही स्कोप की मदद से अनुमति देना ज़रूरी होता है:

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

getAllDayEndDate()

पूरे दिन के इस कैलेंडर इवेंट के खत्म होने की तारीख का पता चलता है. (अगर यह पूरे दिन का इवेंट नहीं है, तो यह तरीका अपवाद दिखाता है.) दिखाया गया Date, स्क्रिप्ट के टाइम ज़ोन में इवेंट खत्म होने के बाद के दिन की आधी रात को दिखाता है. इसके बजाय, कैलेंडर के समय क्षेत्र का इस्तेमाल करने के लिए, getEndTime() पर कॉल करें.

// Gets the user's default calendar. To get a different calendar, use getCalendarById()
// instead.
const calendar = CalendarApp.getDefaultCalendar();

// Creates an event named 'My all-day event' for May 16, 2023.
const event = calendar.createAllDayEvent('My all-day event', new Date('May 16, 2023'));

// Gets the event's end date and logs it.
const endDate = event.getAllDayEndDate();
console.log(endDate);

रिटर्न

Date — पूरे दिन के कैलेंडर इवेंट के खत्म होने की तारीख

थ्रो

Error — अगर यह इवेंट पूरे दिन का इवेंट नहीं है

अनुमति देना

इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट को, इनमें से एक या उससे ज़्यादा स्कोप या मिलते-जुलते REST API के सही स्कोप की मदद से अनुमति देना ज़रूरी होता है:

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

getAllDayStartDate()

पूरे दिन के इस कैलेंडर इवेंट के शुरू होने की तारीख का पता चलता है. (अगर यह पूरे-दिन का इवेंट नहीं है, तो यह तरीका अपवाद दिखाता है.) दिखाया गया Date, स्क्रिप्ट के टाइम ज़ोन में इवेंट शुरू होने वाले दिन की आधी रात को दिखाता है. इसके बजाय, कैलेंडर के समय क्षेत्र का इस्तेमाल करने के लिए, getStartTime() पर कॉल करें.

// Gets the user's default calendar. To get a different calendar, use getCalendarById()
// instead.
const calendar = CalendarApp.getDefaultCalendar();

// Creates an event named 'My all-day event' for May 16, 2023.
const event = calendar.createAllDayEvent('My all-day event', new Date('May 16, 2023'));

// Gets the event's start date and logs it.
const startDate = event.getAllDayStartDate();
console.log(startDate);

रिटर्न

Date — पूरे दिन के कैलेंडर इवेंट के शुरू होने की तारीख

थ्रो

Error — अगर यह इवेंट पूरे दिन का इवेंट नहीं है

अनुमति देना

इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट को, इनमें से एक या उससे ज़्यादा स्कोप या मिलते-जुलते REST API के सही स्कोप की मदद से अनुमति देना ज़रूरी होता है:

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

getAllTagKeys()

इवेंट पर सेट किए गए टैग की सभी कुंजियां मिलती हैं.

रिटर्न

String[] — स्ट्रिंग कुंजियों का कलेक्शन

अनुमति देना

इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट को, इनमें से एक या उससे ज़्यादा स्कोप या मिलते-जुलते REST API के सही स्कोप की मदद से अनुमति देना ज़रूरी होता है:

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

getColor()

कैलेंडर इवेंट का रंग दिखाता है.

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

// Gets the color of the calendar event and logs it.
const eventColor = event.getColor();
console.log(eventColor);

रिटर्न

String — यह स्ट्रिंग में CalendarApp.EventColor से ली गई वैल्यू के इंडेक्स (1-11) के तौर पर इवेंट के रंग को दिखाया जाता है.

अनुमति देना

इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट को, इनमें से एक या उससे ज़्यादा स्कोप या मिलते-जुलते REST API के सही स्कोप की मदद से अनुमति देना ज़रूरी होता है:

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

getCreators()

किसी इवेंट के क्रिएटर की जानकारी मिलती है.

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

// Gets a list of the creators of the event and logs it.
console.log(event.getCreators());

रिटर्न

String[] — इवेंट के निर्माताओं के ईमेल पते

अनुमति देना

इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट को, इनमें से एक या उससे ज़्यादा स्कोप या मिलते-जुलते REST API के सही स्कोप की मदद से अनुमति देना ज़रूरी होता है:

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

getDateCreated()

इवेंट बनाने की तारीख का पता चलता है. आपके पास कैलेंडर का ऐक्सेस होना चाहिए.

// Opens the calendar by using its ID.
// To get the user's default calendar use CalendarApp.getDefault() instead.
// TODO(developer): Replace the calendar ID with your own.
const calendar = CalendarApp.getCalendarById('abc123456@group.calendar.google.com');

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

if (event) {
 // If an event exists within the given time frame, gets the date that the event
 // was created and logs it.
 const eventCreated = event.getDateCreated();
 console.log(eventCreated);
} else {
 // If no event exists within the given time frame, logs that information to the console.
 console.log('No events exist for the specified range');
}

रिटर्न

Date — बनाए जाने की तारीख

अनुमति देना

इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट को, इनमें से एक या उससे ज़्यादा स्कोप या मिलते-जुलते REST API के सही स्कोप की मदद से अनुमति देना ज़रूरी होता है:

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

getDescription()

इवेंट की जानकारी मिलती है. आपके पास कैलेंडर में बदलाव करने का ऐक्सेस होना चाहिए.

// Opens the calendar by its ID.
// To get the user's default calendar use CalendarApp.getDefault() instead.
// TODO(developer): Replace the ID with your own.
const calendar = CalendarApp.getCalendarById('abc123456@group.calendar.google.com');

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

if (event) {
 // If an event exists within the given time frame, sets the description of the event.
 event.setDescription('Important meeting');

 // Gets the description of the event and logs it.
 const description = event.getDescription();
 console.log(description);
} else {
 // If no event exists within the given time frame, logs that information to the console.
 console.log('No events exist for the specified range');
}

रिटर्न

String — जानकारी

अनुमति देना

इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट को, इनमें से एक या उससे ज़्यादा स्कोप या मिलते-जुलते REST API के सही स्कोप की मदद से अनुमति देना ज़रूरी होता है:

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

getEmailReminders()

इवेंट के लिए सभी ईमेल रिमाइंडर के लिए मिनट की वैल्यू दिखाता है. आपके पास कैलेंडर में बदलाव करने का ऐक्सेस होना चाहिए.

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

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

if (event) {
 // If an event exists within the given time frame, adds email reminders for the user to be
 // sent at 4 and 7 minutes before the event.
 event.addEmailReminder(4);
 event.addEmailReminder(7);

 // Gets the minute values for all email reminders that are set up for the user for this event
 // and logs it.
 const emailReminder = event.getEmailReminders();
 console.log(emailReminder);
} else {
 // If no event exists within the given time frame, logs that information to the console.
 console.log('No events exist for the specified range');
}

रिटर्न

Integer[] — वह कलेक्शन जिसमें हर वैल्यू, रिमाइंडर ट्रिगर होने के इवेंट से पहले के मिनट के हिसाब से होती है

अनुमति देना

इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट को, इनमें से एक या उससे ज़्यादा स्कोप या मिलते-जुलते REST API के सही स्कोप की मदद से अनुमति देना ज़रूरी होता है:

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

getEndTime()

कैलेंडर इवेंट के खत्म होने की तारीख और समय की जानकारी मिलती है. आपके पास कैलेंडर का ऐक्सेस होना चाहिए. पूरे दिन के नहीं होने वाले इवेंट के लिए, यह वह समय होता है जब इवेंट खत्म होने के लिए तय किया गया था. पूरे दिन के इवेंट के लिए, जिनमें सिर्फ़ खत्म होने की तारीख (तारीख और समय नहीं) स्टोर होती है, यह कैलेंडर के समय क्षेत्र में इवेंट खत्म होने के बाद की शुरुआत की आधी रात का होता है. इससे सभी तरह के इवेंट के खत्म होने के समय की सही तुलना की जा सकती है. हालांकि, इसमें साल के मूल दिन को बिना बदलाव के सुरक्षित रखना ज़रूरी नहीं है.

पूरे दिन के इवेंट के लिए, इस तरीके की तुलना में getAllDayEndDate() को हमेशा कॉल किया जाना चाहिए.

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

// Gets the first event from the calendar for February 1st, 2023 that takes place
// between 4:00 PM and 5:00 PM.
const event =
  calendar.getEvents(new Date('Feb 01, 2023 16:00:00'), new Date('Feb 01, 2023 17:00:00'))[0];

if (event) {
 // If an event exists within the given time frame, gets the date and time at which the
 // event ends and logs it.
 console.log(event.getEndTime());
} else {
 // If no event exists within the given time frame, logs that info to the console.
 console.log('No events exist for the specified range');
}

रिटर्न

Date — इस कैलेंडर इवेंट के खत्म होने का समय

अनुमति देना

इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट को, इनमें से एक या उससे ज़्यादा स्कोप या मिलते-जुलते REST API के सही स्कोप की मदद से अनुमति देना ज़रूरी होता है:

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

getEventSeries()

इस इवेंट से जुड़े बार-बार होने वाले इवेंट की सीरीज़ पाएं. आपके पास कैलेंडर का ऐक्सेस होना चाहिए. अगर यह इवेंट किसी सीरीज़ से न जुड़ा हो, तब भी CalendarEventSeries ऑब्जेक्ट दिखाया जाता है. इससे, बार-बार होने की नई सेटिंग जोड़ी जा सकती हैं.

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

// Gets the first event from the calendar for February 18th, 2023 that takes place between
// 1:00 PM and 2:00 PM.
const event =
  calendar.getEvents(new Date('Feb 18, 2023 13:00:00'), new Date('Feb 18, 2023 14:00:00'))[0];

if (event) {
 // If an event exists within the given time frame, gets the event series for the event
 // and sets the color to pale green.
 event.getEventSeries().setColor(CalendarApp.EventColor.PALE_GREEN);
} else {
 // If no event exists within the given time frame, logs that information to the console.
 console.log('No events exist for the specified range');
}

रिटर्न

CalendarEventSeries — वह इवेंट सीरीज़ जिसका यह इवेंट है या अगर यह अब तक किसी सीरीज़ से जुड़ी नहीं है, तो एक नई इवेंट सीरीज़

अनुमति देना

इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट को, इनमें से एक या उससे ज़्यादा स्कोप या मिलते-जुलते REST API के सही स्कोप की मदद से अनुमति देना ज़रूरी होता है:

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

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());
}

पैरामीटर

नामTypeब्यौरा
emailStringमेहमान का पता

रिटर्न

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());
}

पैरामीटर

नामTypeब्यौरा
includeOwnerBooleanक्या मालिकों को मेहमान के तौर पर शामिल करना है

रिटर्न

EventGuest[] — मेहमानों की सूची

अनुमति देना

इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट को, इनमें से एक या उससे ज़्यादा स्कोप या मिलते-जुलते REST API के सही स्कोप की मदद से अनुमति देना ज़रूरी होता है:

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

getId()

इवेंट का यूनीक iCalUID की जानकारी मिलती है. ध्यान दें कि Calendar v3 API और कैलेंडर की बेहतर सेवा के लिए इस्तेमाल किया जाने वाला iCalUID और इवेंट id, एक जैसे नहीं हैं. साथ ही, इनका इस्तेमाल एक-दूसरे की जगह पर नहीं किया जा सकता. इनके सिमेंटिक्स में एक अंतर यह है कि बार-बार होने वाले इवेंट में, एक ही इवेंट के सभी इंस्टेंस में अलग-अलग ids होते हैं, जबकि सभी का iCalUID एक ही होता है.

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

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

// Gets the ID of the event and logs it.
console.log(event.getId());

रिटर्न

String — इवेंट का iCalUID

अनुमति देना

इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट को, इनमें से एक या उससे ज़्यादा स्कोप या मिलते-जुलते REST API के सही स्कोप की मदद से अनुमति देना ज़रूरी होता है:

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

getLastUpdated()

उस तारीख की जानकारी मिलती है जिस दिन इवेंट को आखिरी बार अपडेट किया गया था.

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

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

// Gets the date the event was last updated and logs it.
const eventUpdatedDate = event.getLastUpdated();
console.log(eventUpdatedDate);

रिटर्न

Date — पिछली बार अपडेट करने की तारीख

अनुमति देना

इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट को, इनमें से एक या उससे ज़्यादा स्कोप या मिलते-जुलते REST API के सही स्कोप की मदद से अनुमति देना ज़रूरी होता है:

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

getLocation()

इवेंट की जगह की जानकारी मिलती है.

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

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

if (event) {
 // If an event exists within the given time frame, sets the location of the event to Mumbai.
 event.setLocation('Mumbai');

 // Gets the location of the event and logs it.
 const eventLocation = event.getLocation();
 console.log(eventLocation);
} else {
 // If no event exists within the given time frame, logs that information to the console.
 console.log('No events exist for the specified range');
}

रिटर्न

String — इवेंट की जगह

अनुमति देना

इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट को, इनमें से एक या उससे ज़्यादा स्कोप या मिलते-जुलते REST API के सही स्कोप की मदद से अनुमति देना ज़रूरी होता है:

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

getMyStatus()

असरदार उपयोगकर्ता के इवेंट की स्थिति की जानकारी मिलती है. जैसे, इवेंट में शामिल होना या उसे न्योता भेजना. अगर इवेंट का मालिकाना हक सही उपयोगकर्ता के पास होता है, तो इवेंट GuestStatus.OWNER को हमेशा दिखाता है.

// Opens the calendar by its ID.
// TODO(developer): Replace the ID with your own.
const calendar = CalendarApp.getCalendarById('abc123456@group.calendar.google.');

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

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

रिटर्न

GuestStatus — स्टेटस

अनुमति देना

इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट को, इनमें से एक या उससे ज़्यादा स्कोप या मिलते-जुलते REST API के सही स्कोप की मदद से अनुमति देना ज़रूरी होता है:

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

getOriginalCalendarId()

उस कैलेंडर का आईडी पाएं जहां से यह इवेंट मूल रूप से बनाया गया था.

// 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

getStartTime()

कैलेंडर इवेंट के शुरू होने की तारीख और समय की जानकारी मिलती है. पूरे दिन के इवेंट के लिए, यह वह समय होता है जब इवेंट शुरू होने के लिए तय किया गया था. पूरे दिन के इवेंट के लिए, जिसमें सिर्फ़ शुरू होने की तारीख (तारीख और समय नहीं) सेव होती है, यह उस दिन की आधी रात का समय होता है जिस दिन इवेंट कैलेंडर के समय क्षेत्र में शुरू होता है. इससे सभी तरह के इवेंट के लिए, शुरू होने के समय की सही तुलना की जा सकती है. हालांकि, ऐसा ज़रूरी नहीं है कि साल के पहले दिन की जानकारी में कोई बदलाव न किया गया हो.

पूरे दिन के इवेंट के लिए, इस तरीके की तुलना में getAllDayStartDate() को हमेशा कॉल किया जाना चाहिए.

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

// Gets the first event from the calendar for February 1st, 2023 that takes place
// between 4:10 PM and 4:25 PM.
const event =
  calendar.getEvents(new Date('Feb 01, 2023 16:10:00'), new Date('Feb 01, 2023 16:25:00'))[0];

// Gets the date and time at which this calendar event begins and logs it.
const startTime = event.getStartTime();
console.log(startTime);

रिटर्न

Date — इस कैलेंडर इवेंट के शुरू होने का समय

अनुमति देना

इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट को, इनमें से एक या उससे ज़्यादा स्कोप या मिलते-जुलते REST API के सही स्कोप की मदद से अनुमति देना ज़रूरी होता है:

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

getTag(key)

इवेंट की टैग वैल्यू दिखाता है.

पैरामीटर

नामTypeब्यौरा
keyStringकुंजी

रिटर्न

String — टैग की वैल्यू

अनुमति देना

इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट को, इनमें से एक या उससे ज़्यादा स्कोप या मिलते-जुलते REST API के सही स्कोप की मदद से अनुमति देना ज़रूरी होता है:

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

getTitle()

इवेंट के शीर्षक की जानकारी मिलती है.

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

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

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

रिटर्न

String — टाइटल

अनुमति देना

इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट को, इनमें से एक या उससे ज़्यादा स्कोप या मिलते-जुलते REST API के सही स्कोप की मदद से अनुमति देना ज़रूरी होता है:

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

getVisibility()

इवेंट किसे दिखे, इस बारे में जानकारी मिलती है.

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

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

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

रिटर्न

Visibility — प्रॉडक्ट के दिखने की वैल्यू

अनुमति देना

इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट को, इनमें से एक या उससे ज़्यादा स्कोप या मिलते-जुलते REST API के सही स्कोप की मदद से अनुमति देना ज़रूरी होता है:

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

guestsCanInviteOthers()

इससे तय होता है कि मेहमान दूसरे मेहमानों को न्योता भेज सकते हैं या नहीं.

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

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

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

रिटर्न

Boolean — अगर मेहमान अन्य लोगों को न्योता भेज सकते हैं, तो true; अगर मेहमान अन्य लोगों को न्योता नहीं भेज सकते, तो false

अनुमति देना

इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट को, इनमें से एक या उससे ज़्यादा स्कोप या मिलते-जुलते REST API के सही स्कोप की मदद से अनुमति देना ज़रूरी होता है:

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

guestsCanModify()

इससे यह तय किया जाता है कि मेहमान इवेंट में बदलाव कर सकते हैं या नहीं.

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

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

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

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

रिटर्न

Boolean — अगर मेहमान इवेंट में बदलाव कर सकते हैं, तो true. अगर मेहमान इवेंट में बदलाव नहीं कर सकते, तो false

अनुमति देना

इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट को, इनमें से एक या उससे ज़्यादा स्कोप या मिलते-जुलते REST API के सही स्कोप की मदद से अनुमति देना ज़रूरी होता है:

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

guestsCanSeeGuests()

इससे तय होता है कि मेहमान अन्य मेहमानों को देख सकते हैं या नहीं.

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

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

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

रिटर्न

Booleantrue अगर मेहमान अन्य मेहमानों को देख सकते हैं, तो false अगर नहीं हैं

अनुमति देना

इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट को, इनमें से एक या उससे ज़्यादा स्कोप या मिलते-जुलते REST API के सही स्कोप की मदद से अनुमति देना ज़रूरी होता है:

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

isAllDayEvent()

इससे पता चलता है कि यह पूरे दिन का इवेंट है या नहीं.

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

// Gets the first event from the calendar for January 31st, 2023 that takes place
// between 9:05 AM and 9:15 AM.
const event =
  calendar.getEvents(new Date('Jan 31, 2023 09:05:00'), new Date('Jan 31, 2023 09:15:00'))[0];

// Determines whether this event is an all-day event and logs it.
console.log(event.isAllDayEvent());

रिटर्न

अगर इवेंट पूरे दिन का है, तो Booleantrue. अगर इवेंट दिन भर का नहीं है, तो 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');
}

रिटर्न

Booleantrue, अगर इवेंट का मालिकाना हक, सही उपयोगकर्ता के पास है, तो false अगर नहीं है

अनुमति देना

इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट को, इनमें से एक या उससे ज़्यादा स्कोप या मिलते-जुलते REST API के सही स्कोप की मदद से अनुमति देना ज़रूरी होता है:

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

isRecurringEvent()

यह तय करता है कि इवेंट किसी इवेंट सीरीज़ का हिस्सा है या नहीं.

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

// Gets the first event from the calendar for Januart 31st, 2023 that takes place
// between 9:00 AM and 10:00 AM.
const event =
  calendar.getEvents(new Date('Jan 31, 2023 09:00:00'), new Date('Jan 31, 2023 10:00:00'))[0];

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

रिटर्न

Boolean — अगर इवेंट किसी इवेंट सीरीज़ का हिस्सा है, तो true; अगर इवेंट सीरीज़ का हिस्सा नहीं है, तो false

अनुमति देना

इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट को, इनमें से एक या उससे ज़्यादा स्कोप या मिलते-जुलते REST API के सही स्कोप की मदद से अनुमति देना ज़रूरी होता है:

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

removeAllReminders()

इवेंट के सभी रिमाइंडर हटा देता है.

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

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

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

रिटर्न

CalendarEvent — यह CalendarEvent चेन बनाने के लिए है

अनुमति देना

इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट को, इनमें से एक या उससे ज़्यादा स्कोप या मिलते-जुलते REST API के सही स्कोप की मदद से अनुमति देना ज़रूरी होता है:

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

removeGuest(email)

इवेंट से मेहमान को हटाता है.

// Example 1: Remove a guest from one event
function removeGuestFromEvent() {
  // Replace the below values with your own
  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);
  }
}

पैरामीटर

नामTypeब्यौरा
emailStringमेहमान का ईमेल पता

रिटर्न

CalendarEvent — यह CalendarEvent चेन बनाने के लिए है

अनुमति देना

इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट को, इनमें से एक या उससे ज़्यादा स्कोप या मिलते-जुलते REST API के सही स्कोप की मदद से अनुमति देना ज़रूरी होता है:

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

resetRemindersToDefault()

कैलेंडर की डिफ़ॉल्ट सेटिंग का इस्तेमाल करके रिमाइंडर रीसेट करता है.

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

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

if (event) {
 // If an event exists within the given time frame, resets the reminders using the calendar's
 // default settings.
 event.resetRemindersToDefault();
} else {
 // If no event exists within the given time frame, logs that information to the console.
 console.log('No events exist for the specified range');
}

रिटर्न

CalendarEvent — यह CalendarEvent चेन बनाने के लिए है

अनुमति देना

इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट को, इनमें से एक या उससे ज़्यादा स्कोप या मिलते-जुलते REST API के सही स्कोप की मदद से अनुमति देना ज़रूरी होता है:

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

setAllDayDate(date)

इवेंट की तारीख सेट करता है. इस तरीके को लागू करने पर, सामान्य इवेंट पूरे दिन के इवेंट में बदल जाता है.

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

// Gets the first event from the calendar for February 17th, 2023 that takes place
// between 4:00 PM and 5:00 PM.
const event =
  calendar.getEvents(new Date('Feb 17, 2023 16:00:00'), new Date('Feb 17, 2023 17:00:00'))[0];

if (event) {
 // If an event exists within the given time frame, sets the date of the event and updates
 // it to an all-day event.
 event.setAllDayDate(new Date('Feb 17, 2023'));
} else {
 // If no event exists within the given time frame, logs that information to the console.
 console.log('No events exist for the specified range');
}

पैरामीटर

नामTypeब्यौरा
dateDateइवेंट की तारीख (समय को अनदेखा किया जाता है)

रिटर्न

CalendarEvent — यह CalendarEvent चेन बनाने के लिए है

अनुमति देना

इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट को, इनमें से एक या उससे ज़्यादा स्कोप या मिलते-जुलते REST API के सही स्कोप की मदद से अनुमति देना ज़रूरी होता है:

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

setAllDayDates(startDate, endDate)

इवेंट की तारीखें सेट करता है. इस तरीके को लागू करने पर, सामान्य इवेंट पूरे दिन वाले इवेंट में बदल जाता है.

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

// Gets the first event from the calendar for February 18th, 2023 that takes place
// between 4:00 PM and 5:00 PM.
const event =
  calendar.getEvents(new Date('Feb 18, 2023 16:00:00'), new Date('Feb 18, 2023 17:00:00'))[0];

if (event) {
 // If an event exists within the given time frame, sets the event to be an all-day event from
 // Feb 18th, 2023 until Feb 25th, 2023. Applying this method changes a regular event into an
 // all-day event.
 event.setAllDayDates(new Date('Feb 18, 2023'), new Date('Feb 25, 2023'));
} else {
 // If no event exists within the given time frame, logs that information to the console.
 console.log('No events exist for the specified range');
}

पैरामीटर

नामTypeब्यौरा
startDateDateइवेंट शुरू होने की तारीख (समय को अनदेखा किया जाता है)
endDateDateइवेंट खत्म होने की तारीख (समय को अनदेखा किया जाता है)

रिटर्न

CalendarEvent — यह CalendarEvent चेन बनाने के लिए है

अनुमति देना

इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट को, इनमें से एक या उससे ज़्यादा स्कोप या मिलते-जुलते REST API के सही स्कोप की मदद से अनुमति देना ज़रूरी होता है:

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

setAnyoneCanAddSelf(anyoneCanAddSelf)

सेट करता है कि गैर-मेहमान खुद को इवेंट में जोड़ सकते हैं या नहीं.

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

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

if (event) {
 // If an event exists within the given time frame, sets the event so that non-guests
 // can't add themselves to the event.
 event.setAnyoneCanAddSelf(false);
} else {
 // If no event exists within the given time frame, logs that information to the console.
 console.log('No events exist for the specified range');
}

पैरामीटर

नामTypeब्यौरा
anyoneCanAddSelfBooleanकोई भी व्यक्ति खुद को आमंत्रित कर सकता है या नहीं

रिटर्न

CalendarEvent — यह CalendarEvent चेन बनाने के लिए है

अनुमति देना

इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट को, इनमें से एक या उससे ज़्यादा स्कोप या मिलते-जुलते REST API के सही स्कोप की मदद से अनुमति देना ज़रूरी होता है:

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

setColor(color)

कैलेंडर इवेंट का रंग सेट करता है.

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

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

if (event) {
 // If an event exists within the given time frame, sets the color of the calendar event to
 // green.
 event.setColor(CalendarApp.EventColor.GREEN);
} else {
 // If no event exists within the given time frame, logs that information to the console.
 console.log('No events exist for the specified range');
}

पैरामीटर

नामTypeब्यौरा
colorStringस्ट्रिंग के तौर पर पूर्णांक वाला कलर इंडेक्स या CalendarApp.EventColor से मिली वैल्यू.

रिटर्न

CalendarEvent — यह कैलेंडर इवेंट, चेन बनाने के लिए है.

अनुमति देना

इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट को, इनमें से एक या उससे ज़्यादा स्कोप या मिलते-जुलते REST API के सही स्कोप की मदद से अनुमति देना ज़रूरी होता है:

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

setDescription(description)

इवेंट की जानकारी सेट करता है.

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

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

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

पैरामीटर

नामTypeब्यौरा
descriptionStringनया ब्यौरा

रिटर्न

CalendarEvent — यह CalendarEvent चेन बनाने के लिए है

अनुमति देना

इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट को, इनमें से एक या उससे ज़्यादा स्कोप या मिलते-जुलते REST API के सही स्कोप की मदद से अनुमति देना ज़रूरी होता है:

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

setGuestsCanInviteOthers(guestsCanInviteOthers)

सेट करता है कि मेहमान अन्य मेहमानों को न्योता भेज सकते हैं या नहीं.

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

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

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

पैरामीटर

नामTypeब्यौरा
guestsCanInviteOthersBooleanक्या मेहमान अन्य लोगों को आमंत्रित कर सकते हैं

रिटर्न

CalendarEvent — यह CalendarEvent चेन बनाने के लिए है

अनुमति देना

इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट को, इनमें से एक या उससे ज़्यादा स्कोप या मिलते-जुलते REST API के सही स्कोप की मदद से अनुमति देना ज़रूरी होता है:

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

setGuestsCanModify(guestsCanModify)

सेट करता है कि मेहमान इवेंट में बदलाव कर सकते हैं या नहीं.

पैरामीटर

नामTypeब्यौरा
guestsCanModifyBooleanक्या मेहमान इवेंट में बदलाव कर सकते हैं

रिटर्न

CalendarEvent — यह CalendarEvent चेन बनाने के लिए है

अनुमति देना

इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट को, इनमें से एक या उससे ज़्यादा स्कोप या मिलते-जुलते REST API के सही स्कोप की मदद से अनुमति देना ज़रूरी होता है:

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

setGuestsCanSeeGuests(guestsCanSeeGuests)

सेट करता है कि क्या मेहमान अन्य मेहमानों को देख सकते हैं.

पैरामीटर

नामTypeब्यौरा
guestsCanSeeGuestsBooleanक्या मेहमान अन्य लोगों को देख सकते हैं

रिटर्न

CalendarEvent — यह CalendarEvent चेन बनाने के लिए है

अनुमति देना

इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट को, इनमें से एक या उससे ज़्यादा स्कोप या मिलते-जुलते REST API के सही स्कोप की मदद से अनुमति देना ज़रूरी होता है:

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

setLocation(location)

इवेंट की जगह सेट करता है.

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

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

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

पैरामीटर

नामTypeब्यौरा
locationStringनई जगह

रिटर्न

CalendarEvent — यह CalendarEvent चेन बनाने के लिए है

अनुमति देना

इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट को, इनमें से एक या उससे ज़्यादा स्कोप या मिलते-जुलते REST API के सही स्कोप की मदद से अनुमति देना ज़रूरी होता है:

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

setMyStatus(status)

असरदार उपयोगकर्ता के इवेंट की स्थिति सेट करती है, जैसे कि इवेंट में शामिल होना या उसे न्योता भेजना.

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

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

if (event) {
 // If an event exists within the given time frame, sets the event status for the current user
 to maybe.
 event.setMyStatus(CalendarApp.GuestStatus.MAYBE);
} else {
 // If no event exists within the given time frame, logs that information to the console.
 console.log('No events exist for the specified range');
}

पैरामीटर

नामTypeब्यौरा
statusGuestStatusनई स्थिति

रिटर्न

CalendarEvent — यह CalendarEvent चेन बनाने के लिए है

अनुमति देना

इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट को, इनमें से एक या उससे ज़्यादा स्कोप या मिलते-जुलते REST API के सही स्कोप की मदद से अनुमति देना ज़रूरी होता है:

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

setTag(key, value)

कस्टम मेटाडेटा को सेव करने के लिए, इवेंट पर कुंजी/वैल्यू टैग सेट करता है.

पैरामीटर

नामTypeब्यौरा
keyStringटैग कुंजी
valueStringटैग का मान

रिटर्न

CalendarEvent — यह CalendarEvent चेन बनाने के लिए है

अनुमति देना

इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट को, इनमें से एक या उससे ज़्यादा स्कोप या मिलते-जुलते REST API के सही स्कोप की मदद से अनुमति देना ज़रूरी होता है:

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

setTime(startTime, endTime)

इवेंट के शुरू और खत्म होने की तारीख और समय सेट करता है. इस तरीके को लागू करने पर, पूरे दिन का इवेंट, सामान्य इवेंट में बदल जाता है.

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

// Declares a start time of 11:00 AM on February 20th, 2023 and an end time of 12:00 PM on
// February 20th, 2023.
const startTime = new Date('Feb 20,2023 11:00:00');
const endTime = new Date('Feb 20, 2023  12:00:00');

// Creates an all-day event on February 20th, 2023.
const event = calendar.createAllDayEvent('Meeting', new Date('Feb 20,2023'));

// Updates the all-day event to a regular event by setting a start and end time for the event.
event.setTime(startTime, endTime);

पैरामीटर

नामTypeब्यौरा
startTimeDateइवेंट की नई शुरुआत
endTimeDateइवेंट की नई समाप्ति

रिटर्न

CalendarEvent — यह CalendarEvent चेन बनाने के लिए है

अनुमति देना

इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट को, इनमें से एक या उससे ज़्यादा स्कोप या मिलते-जुलते REST API के सही स्कोप की मदद से अनुमति देना ज़रूरी होता है:

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

setTitle(title)

इवेंट का शीर्षक सेट करता है.

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

// Gets the first event from the calendar for January 31st, 2023 that takes place
// between 9:05 AM and 9:15 AM.
// For an event series, use calendar.getEventSeriesById('abc123456@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');
}

पैरामीटर

नामTypeब्यौरा
titleStringनया टाइटल

रिटर्न

CalendarEvent — यह CalendarEvent चेन बनाने के लिए है

अनुमति देना

इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट को, इनमें से एक या उससे ज़्यादा स्कोप या मिलते-जुलते REST API के सही स्कोप की मदद से अनुमति देना ज़रूरी होता है:

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

setVisibility(visibility)

इवेंट की दृश्यता सेट करता है.

पैरामीटर

नामTypeब्यौरा
visibilityVisibility

रिटर्न

CalendarEvent — यह CalendarEvent चेन बनाने के लिए है

अनुमति देना

इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट को, इनमें से एक या उससे ज़्यादा स्कोप या मिलते-जुलते REST API के सही स्कोप की मदद से अनुमति देना ज़रूरी होता है:

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