Class CalendarEvent

CalendarEvent

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

तरीके

तरीकारिटर्न टाइपसंक्षिप्त विवरण
addEmailReminder(minutesBefore)CalendarEventइवेंट के लिए एक नया ईमेल रिमाइंडर जोड़ता है.
addGuest(email)CalendarEventइवेंट में किसी मेहमान को जोड़ता है.
addPopupReminder(minutesBefore)CalendarEventइवेंट में एक नया पॉप-अप नोटिफ़िकेशन जोड़ता है.
addSmsReminder(minutesBefore)CalendarEventइवेंट के लिए एक नया एसएमएस रिमाइंडर जोड़ता है.
anyoneCanAddSelf()Booleanइससे यह तय होता है कि लोग खुद को Calendar इवेंट में मेहमानों के तौर पर जोड़ सकते हैं या नहीं.
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)

इवेंट के लिए एक नया ईमेल रिमाइंडर जोड़ता है. रिमाइंडर कम से कम 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);

पैरामीटर

नामटाइपब्यौरा
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);
  }
}

पैरामीटर

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

वापसी का टिकट

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

अनुमति देना

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

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

addPopupReminder(minutesBefore)

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

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

// Adds a pop-up notification for 15 minutes before the event.
event.addPopupReminder(15);

पैरामीटर

नामटाइपब्यौरा
minutesBeforeIntegerइवेंट से इतने मिनट पहले

वापसी का टिकट

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

अनुमति देना

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

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

addSmsReminder(minutesBefore)

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

पैरामीटर

नामटाइपब्यौरा
minutesBeforeIntegerइवेंट से इतने मिनट पहले

वापसी का टिकट

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

थ्रो

Error — अगर इवेंट के बारे में बताने के लिए पांच से ज़्यादा रिमाइंडर हों या इवेंट के लिए तय समय की जानकारी न दी जा रही हो कानूनी सीमा के अंदर

अनुमति देना

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

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

anyoneCanAddSelf()

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

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

// Determines whether people can add themselves as guests to the event and logs it.
console.log(event.anyoneCanAddSelf());

वापसी का टिकट

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)

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

पैरामीटर

नामटाइपब्यौरा
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);

वापसी का टिकट

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

पैरामीटर

नामटाइपब्यौरा
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());
}

पैरामीटर

नामटाइपब्यौरा
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 मिलता है. ध्यान दें कि iCalUID और इवेंट id का इस्तेमाल Calendar v3 API और Calendar की ऐडवांस सेवा एक जैसी नहीं हैं. एक-दूसरे की जगह पर इस्तेमाल नहीं किया जा सकता. उनके सिमेंटिक्स में एक अंतर यह है कि बार-बार होने वाले इवेंट में हर बार एक इवेंट की सभी घटनाओं के लिए अलग-अलग 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)

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

पैरामीटर

नामटाइपब्यौरा
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');
}

वापसी का टिकट

Booleantrue अगर मेहमान दूसरों को न्योता भेज सकते हैं; अगर नहीं है, तो 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');
}

वापसी का टिकट

Booleantrue अगर मेहमान इवेंट में बदलाव कर सकते हैं; अगर नहीं है, तो 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');
}

वापसी का टिकट

Booleantrue अगर इवेंट किसी इवेंट सीरीज़ का हिस्सा है; अगर नहीं है, तो 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);
  }
}

पैरामीटर

नामटाइपब्यौरा
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');
}

पैरामीटर

नामटाइपब्यौरा
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');
}

पैरामीटर

नामटाइपब्यौरा
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');
}

पैरामीटर

नामटाइपब्यौरा
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');
}

पैरामीटर

नामटाइपब्यौरा
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');
}

पैरामीटर

नामटाइपब्यौरा
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');
}

पैरामीटर

नामटाइपब्यौरा
guestsCanInviteOthersBooleanक्या मेहमान अन्य लोगों को

वापसी का टिकट

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

अनुमति देना

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

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

setGuestsCanModify(guestsCanModify)

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

पैरामीटर

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

वापसी का टिकट

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

अनुमति देना

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

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

setGuestsCanSeeGuests(guestsCanSeeGuests)

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

पैरामीटर

नामटाइपब्यौरा
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');
}

पैरामीटर

नामटाइपब्यौरा
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');
}

पैरामीटर

नामटाइपब्यौरा
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)

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

पैरामीटर

नामटाइपब्यौरा
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);

पैरामीटर

नामटाइपब्यौरा
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');
}

पैरामीटर

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

वापसी का टिकट

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

अनुमति देना

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

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

setVisibility(visibility)

इससे यह सेट किया जाता है कि इवेंट किसको दिखे.

पैरामीटर

नामटाइपब्यौरा
visibilityVisibility

वापसी का टिकट

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

अनुमति देना

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

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