Class CalendarApp

Calendarऐप्लिकेशन

इस स्कोप से, स्क्रिप्ट को उपयोगकर्ता के Google Calendar को पढ़ने और अपडेट करने की अनुमति मिलती है. यह क्लास, उपयोगकर्ता के डिफ़ॉल्ट कैलेंडर का सीधा ऐक्सेस देती है. साथ ही, यह उन अतिरिक्त कैलेंडर को वापस पाने की सुविधा भी देती है जिनका मालिकाना हक उपयोगकर्ता के पास है या जिनकी सदस्यता उसने ली है.

प्रॉपर्टी

प्रॉपर्टीटाइपब्यौरा
ColorColorयह एक इनम है, जो Calendar सेवा में उपलब्ध रंग दिखाता है.
EventColorEventColorयह एक इनम है. यह Calendar सेवा में उपलब्ध, नाम वाले इवेंट के रंगों को दिखाता है.
EventTransparencyEventTransparencyEventTransparency इन्यूमरेशन.
EventTypeEventTypeEventType इन्यूमरेशन.
GuestStatusGuestStatusयह एक enum है. यह किसी इवेंट के लिए, मेहमान की स्थितियों को दिखाता है.
MonthMonthसाल के महीनों को दिखाने वाला एक enum.
VisibilityVisibilityयह एक इनम है, जो किसी इवेंट के दिखने की सेटिंग को दिखाता है.
WeekdayWeekdayयह enum, हफ़्ते के दिनों को दिखाता है.

तरीके

तरीकारिटर्न टाइपसंक्षिप्त विवरण
createAllDayEvent(title, date)CalendarEventइससे पूरे दिन चलने वाला नया इवेंट बनाया जाता है.
createAllDayEvent(title, startDate, endDate)CalendarEventइससे पूरे दिन चलने वाला एक नया इवेंट बनाया जाता है. यह इवेंट कई दिनों तक चल सकता है.
createAllDayEvent(title, startDate, endDate, options)CalendarEventइससे पूरे दिन चलने वाला एक नया इवेंट बनाया जाता है. यह इवेंट कई दिनों तक चल सकता है.
createAllDayEvent(title, date, options)CalendarEventइससे पूरे दिन चलने वाला नया इवेंट बनाया जाता है.
createAllDayEventSeries(title, startDate, recurrence)CalendarEventSeriesइससे पूरे दिन चलने वाले इवेंट की नई सीरीज़ बनाई जाती है.
createAllDayEventSeries(title, startDate, recurrence, options)CalendarEventSeriesइससे पूरे दिन चलने वाले इवेंट की नई सीरीज़ बनाई जाती है.
createCalendar(name)Calendarयह उपयोगकर्ता के मालिकाना हक वाला नया कैलेंडर बनाता है.
createCalendar(name, options)Calendarयह उपयोगकर्ता के मालिकाना हक वाला नया कैलेंडर बनाता है.
createEvent(title, startTime, endTime)CalendarEventयह कुकी, नया इवेंट बनाती है.
createEvent(title, startTime, endTime, options)CalendarEventयह कुकी, नया इवेंट बनाती है.
createEventFromDescription(description)CalendarEventयह फ़्री-फ़ॉर्म में दिए गए ब्यौरे से इवेंट बनाता है.
createEventSeries(title, startTime, endTime, recurrence)CalendarEventSeriesयह कुकी, नई इवेंट सीरीज़ बनाती है.
createEventSeries(title, startTime, endTime, recurrence, options)CalendarEventSeriesयह कुकी, नई इवेंट सीरीज़ बनाती है.
getAllCalendars()Calendar[]यह उन सभी कैलेंडर को दिखाता है जिनका मालिकाना हक उपयोगकर्ता के पास है या जिनकी उसने सदस्यता ली है.
getAllOwnedCalendars()Calendar[]उपयोगकर्ता के मालिकाना हक वाले सभी कैलेंडर मिलते हैं.
getCalendarById(id)Calendar|nullइस तरीके से, दिए गए आईडी वाला कैलेंडर मिलता है.
getCalendarsByName(name)Calendar[]यह फ़ंक्शन, दिए गए नाम वाले उन सभी कैलेंडर को दिखाता है जिनका मालिकाना हक उपयोगकर्ता के पास है या जिनकी उसने सदस्यता ली है.
getColor()Stringइससे कैलेंडर का रंग मिलता है.
getDefaultCalendar()Calendarइससे उपयोगकर्ता का डिफ़ॉल्ट कैलेंडर मिलता है.
getDescription()Stringकैलेंडर की जानकारी मिलती है.
getEventById(iCalId)CalendarEventइस तरीके से, दिए गए आईडी वाला इवेंट मिलता है.
getEventSeriesById(iCalId)CalendarEventSeriesइस तरीके से, दिए गए आईडी वाली इवेंट सीरीज़ मिलती है.
getEvents(startTime, endTime)CalendarEvent[]इससे किसी तय समयसीमा के अंदर होने वाले सभी इवेंट का डेटा मिलता है.
getEvents(startTime, endTime, options)CalendarEvent[]यह फ़ंक्शन, तय की गई समयसीमा में होने वाले उन सभी इवेंट को दिखाता है जो तय की गई शर्तों को पूरा करते हैं.
getEventsForDay(date)CalendarEvent[]किसी दिए गए दिन होने वाले सभी इवेंट को दिखाता है.
getEventsForDay(date, options)CalendarEvent[]यह फ़ंक्शन, किसी दिन होने वाले उन सभी इवेंट को दिखाता है जो तय की गई शर्तों को पूरा करते हैं.
getId()Stringइस कुकी से कैलेंडर का आईडी मिलता है.
getName()Stringकैलेंडर का नाम मिलता है.
getOwnedCalendarById(id)Calendar|nullअगर उपयोगकर्ता के पास दिए गए आईडी वाला कैलेंडर है, तो उसे मिलता है.
getOwnedCalendarsByName(name)Calendar[]उपयोगकर्ता के मालिकाना हक वाले, दिए गए नाम के सभी कैलेंडर पाएं.
getTimeZone()Stringकैलेंडर का टाइम ज़ोन मिलता है.
isHidden()Booleanइस कुकी से यह तय होता है कि कैलेंडर को यूज़र इंटरफ़ेस में छिपाया गया है या नहीं.
isMyPrimaryCalendar()Booleanइस कुकी से यह पता चलता है कि कैलेंडर, उपयोगकर्ता का मुख्य कैलेंडर है या नहीं.
isOwnedByMe()Booleanयह कुकी यह तय करती है कि कैलेंडर का मालिकाना हक आपके पास है या नहीं.
isSelected()Booleanइस कुकी से यह तय होता है कि कैलेंडर के इवेंट, यूज़र इंटरफ़ेस में दिखेंगे या नहीं.
newRecurrence()EventRecurrenceयह एक नया recurrence ऑब्जेक्ट बनाता है. इसका इस्तेमाल, इवेंट के बार-बार होने के नियम बनाने के लिए किया जा सकता है.
setColor(color)Calendarइससे कैलेंडर का रंग सेट किया जाता है.
setDescription(description)Calendarइस तरीके का इस्तेमाल करके, किसी कैलेंडर की जानकारी सेट की जाती है.
setHidden(hidden)Calendarइस कुकी से यह तय होता है कि कैलेंडर, यूज़र इंटरफ़ेस में दिखेगा या नहीं.
setName(name)Calendarइससे कैलेंडर का नाम सेट किया जाता है.
setSelected(selected)Calendarइस सेटिंग से यह तय होता है कि कैलेंडर के इवेंट, यूज़र इंटरफ़ेस में दिखेंगे या नहीं.
setTimeZone(timeZone)Calendarकैलेंडर का टाइम ज़ोन सेट करता है.
subscribeToCalendar(id)Calendarअगर उपयोगकर्ता को सदस्यता लेने की अनुमति है, तो यह फ़ंक्शन उसे दिए गए आईडी वाले कैलेंडर की सदस्यता दिलाता है.
subscribeToCalendar(id, options)Calendarअगर उपयोगकर्ता को सदस्यता लेने की अनुमति है, तो यह फ़ंक्शन उसे दिए गए आईडी वाले कैलेंडर की सदस्यता दिलाता है.

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

createAllDayEvent(title, date)

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

// Creates an all-day event for the moon landing and logs the ID.
const event = CalendarApp.getDefaultCalendar().createAllDayEvent(
    'Apollo 11 Landing',
    new Date('July 20, 1969'),
);
Logger.log(`Event ID: ${event.getId()}`);

पैरामीटर

नामटाइपब्यौरा
titleStringइवेंट का टाइटल.
dateDateइवेंट की तारीख (सिर्फ़ दिन का इस्तेमाल किया जाता है; समय को अनदेखा किया जाता है).

वापसी का टिकट

CalendarEvent — बनाया गया इवेंट.

अनुमति देना

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

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

createAllDayEvent(title, startDate, endDate)

इससे पूरे दिन चलने वाला एक नया इवेंट बनाया जाता है. यह इवेंट कई दिनों तक चल सकता है.

// Creates an all-day event for the Woodstock festival (August 15th to 17th) and
// logs the ID.
const event = CalendarApp.getDefaultCalendar().createAllDayEvent(
    'Woodstock Festival',
    new Date('August 15, 1969'),
    new Date('August 18, 1969'),
);
Logger.log(`Event ID: ${event.getId()}`);

पैरामीटर

नामटाइपब्यौरा
titleStringइवेंट का टाइटल.
startDateDateइवेंट के शुरू होने की तारीख. इसमें सिर्फ़ दिन का इस्तेमाल किया जाता है. समय को अनदेखा कर दिया जाता है.
endDateDateइवेंट के खत्म होने की तारीख. इसमें सिर्फ़ दिन का इस्तेमाल किया जाता है. समय को अनदेखा कर दिया जाता है. खत्म होने की तारीख शामिल नहीं होती.

वापसी का टिकट

CalendarEvent — बनाया गया इवेंट.

अनुमति देना

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

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

createAllDayEvent(title, startDate, endDate, options)

इससे पूरे दिन चलने वाला एक नया इवेंट बनाया जाता है. यह इवेंट कई दिनों तक चल सकता है.

// Creates an all-day event for the Woodstock festival (August 15th to 17th) and
// logs the ID.
const event = CalendarApp.getDefaultCalendar().createAllDayEvent(
    'Woodstock Festival',
    new Date('August 15, 1969'),
    new Date('August 18, 1969'),
    {location: 'Bethel, White Lake, New York, U.S.', sendInvites: true},
);
Logger.log(`Event ID: ${event.getId()}`);

पैरामीटर

नामटाइपब्यौरा
titleStringइवेंट का टाइटल.
startDateDateइवेंट के शुरू होने की तारीख. इसमें सिर्फ़ दिन का इस्तेमाल किया जाता है. समय को अनदेखा कर दिया जाता है.
endDateDateइवेंट के खत्म होने की तारीख. इसमें सिर्फ़ दिन का इस्तेमाल किया जाता है. समय को अनदेखा कर दिया जाता है. खत्म होने की तारीख शामिल नहीं होती.
optionsObjectयह एक JavaScript ऑब्जेक्ट है. इसमें नीचे दिए गए अडवांस पैरामीटर शामिल होते हैं.

उन्नत पैरामीटर

नामटाइपब्यौरा
descriptionStringइवेंट के बारे में जानकारी.
locationStringइवेंट की जगह.
guestsStringमेहमानों के तौर पर जोड़े जाने वाले ईमेल पतों की कॉमा लगाकर अलग की गई सूची.
sendInvitesBooleanन्योते के ईमेल भेजने हैं या नहीं (डिफ़ॉल्ट: false).

वापसी का टिकट

CalendarEvent — बनाया गया इवेंट.

अनुमति देना

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

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

createAllDayEvent(title, date, options)

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

// Creates an all-day event for the moon landing and logs the ID.
const event = CalendarApp.getDefaultCalendar().createAllDayEvent(
    'Apollo 11 Landing',
    new Date('July 20, 1969'),
    {location: 'The Moon'},
);
Logger.log(`Event ID: ${event.getId()}`);

पैरामीटर

नामटाइपब्यौरा
titleStringइवेंट का टाइटल.
dateDateइवेंट की तारीख (सिर्फ़ दिन का इस्तेमाल किया जाता है; समय को अनदेखा किया जाता है).
optionsObjectयह एक JavaScript ऑब्जेक्ट है. इसमें नीचे दिए गए अडवांस पैरामीटर शामिल होते हैं.

उन्नत पैरामीटर

नामटाइपब्यौरा
descriptionStringइवेंट के बारे में जानकारी.
locationStringइवेंट की जगह.
guestsStringमेहमानों के तौर पर जोड़े जाने वाले ईमेल पतों की कॉमा लगाकर अलग की गई सूची.
sendInvitesBooleanन्योते के ईमेल भेजने हैं या नहीं (डिफ़ॉल्ट: false).

वापसी का टिकट

CalendarEvent — बनाया गया इवेंट.

अनुमति देना

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

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

createAllDayEventSeries(title, startDate, recurrence)

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

// Creates an event series for a no-meetings day, taking place every Wednesday
// in 2013.
const eventSeries = CalendarApp.getDefaultCalendar().createAllDayEventSeries(
    'No Meetings',
    new Date('January 2, 2013 03:00:00 PM EST'),
    CalendarApp.newRecurrence()
        .addWeeklyRule()
        .onlyOnWeekday(CalendarApp.Weekday.WEDNESDAY)
        .until(new Date('January 1, 2014')),
);
Logger.log(`Event Series ID: ${eventSeries.getId()}`);

पैरामीटर

नामटाइपब्यौरा
titleStringसीरीज़ में मौजूद इवेंट का टाइटल
startDateDateसीरीज़ में शामिल पहले इवेंट की तारीख (सिर्फ़ दिन का इस्तेमाल किया जाता है; समय को अनदेखा कर दिया जाता है)
recurrenceEventRecurrenceइवेंट सीरीज़ के बार-बार होने की सेटिंग

वापसी का टिकट

CalendarEventSeries — बनाई गई इवेंट सीरीज़

अनुमति देना

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

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

createAllDayEventSeries(title, startDate, recurrence, options)

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

// Creates an event series for a no-meetings day, taking place every Wednesday
// in 2013.
const eventSeries = CalendarApp.getDefaultCalendar().createAllDayEventSeries(
    'No Meetings',
    new Date('January 2, 2013 03:00:00 PM EST'),
    CalendarApp.newRecurrence()
        .addWeeklyRule()
        .onlyOnWeekday(CalendarApp.Weekday.WEDNESDAY)
        .until(new Date('January 1, 2014')),
    {guests: 'everyone@example.com'},
);
Logger.log(`Event Series ID: ${eventSeries.getId()}`);

पैरामीटर

नामटाइपब्यौरा
titleStringसीरीज़ में मौजूद इवेंट का टाइटल
startDateDateसीरीज़ में शामिल पहले इवेंट की तारीख (सिर्फ़ दिन का इस्तेमाल किया जाता है; समय को अनदेखा कर दिया जाता है)
recurrenceEventRecurrenceइवेंट सीरीज़ के बार-बार होने की सेटिंग
optionsObjectएक JavaScript ऑब्जेक्ट, जो नीचे दिए गए अडवांस पैरामीटर तय करता है

उन्नत पैरामीटर

नामटाइपब्यौरा
descriptionStringसीरीज़ में शामिल इवेंट की जानकारी
locationStringसीरीज़ के इवेंट की जगह
guestsStringकॉमा लगाकर अलग किए गए ईमेल पतों की सूची, जिन्हें सीरीज़ के इवेंट में मेहमान के तौर पर जोड़ना है
sendInvitesBooleanन्योते के ईमेल भेजने हैं या नहीं (डिफ़ॉल्ट: false)

वापसी का टिकट

CalendarEventSeries — बनाई गई इवेंट सीरीज़

अनुमति देना

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

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

createCalendar(name)

यह उपयोगकर्ता के मालिकाना हक वाला नया कैलेंडर बनाता है.

// Creates a new calendar named "Travel Plans".
const calendar = CalendarApp.createCalendar('Travel Plans');
Logger.log(
    'Created the calendar "%s", with the ID "%s".',
    calendar.getName(),
    calendar.getId(),
);

पैरामीटर

नामटाइपब्यौरा
nameStringनए कैलेंडर का नाम

वापसी का टिकट

Calendar — नया कैलेंडर

अनुमति देना

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

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

createCalendar(name, options)

यह उपयोगकर्ता के मालिकाना हक वाला नया कैलेंडर बनाता है.

// Creates a new calendar named "Travel Plans" with a description and color.
const calendar = CalendarApp.createCalendar('Travel Plans', {
  description: 'A calendar to plan my travel schedule.',
  color: CalendarApp.Color.BLUE,
});
Logger.log(
    'Created the calendar "%s", with the ID "%s".',
    calendar.getName(),
    calendar.getId(),
);

पैरामीटर

नामटाइपब्यौरा
nameStringनए कैलेंडर का नाम
optionsObjectएक JavaScript ऑब्जेक्ट, जो नीचे दिए गए अडवांस पैरामीटर तय करता है

उन्नत पैरामीटर

नामटाइपब्यौरा
locationStringकैलेंडर की जगह की जानकारी
descriptionStringकैलेंडर की जानकारी
timeZoneStringकैलेंडर के लिए टाइम ज़ोन सेट करें.इसे "long" फ़ॉर्मैट में तय किया जाता है. उदाहरण के लिए, "America/New_York", जैसा कि Joda.org ने बताया है)
colorStringहेक्साडेसिमल रंग की स्ट्रिंग ("#rrggbb") या CalendarApp.Colors से कोई वैल्यू
hiddenBooleanकैलेंडर को यूज़र इंटरफ़ेस में छिपाया गया है या नहीं (डिफ़ॉल्ट: false)
selectedBooleanकैलेंडर के इवेंट, उपयोगकर्ता इंटरफ़ेस में दिखते हैं या नहीं (डिफ़ॉल्ट: true)

वापसी का टिकट

Calendar — नया कैलेंडर

अनुमति देना

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

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

createEvent(title, startTime, endTime)

यह कुकी, नया इवेंट बनाती है.

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

// Creates an event for the moon landing and logs the ID.
const event = CalendarApp.getDefaultCalendar().createEvent(
    'Apollo 11 Landing',
    new Date('July 20, 1969 20:00:00 UTC'),
    new Date('July 21, 1969 21:00:00 UTC'),
);
Logger.log(`Event ID: ${event.getId()}`);

पैरामीटर

नामटाइपब्यौरा
titleStringइवेंट का टाइटल
startTimeDateइवेंट के शुरू होने की तारीख और समय
endTimeDateइवेंट के खत्म होने की तारीख और समय

वापसी का टिकट

CalendarEvent — बनाया गया इवेंट

अनुमति देना

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

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

createEvent(title, startTime, endTime, options)

यह कुकी, नया इवेंट बनाती है.

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

// Creates an event for the moon landing and logs the ID.
const event = CalendarApp.getDefaultCalendar().createEvent(
    'Apollo 11 Landing',
    new Date('July 20, 1969 20:00:00 UTC'),
    new Date('July 20, 1969 21:00:00 UTC'),
    {location: 'The Moon'},
);
Logger.log(`Event ID: ${event.getId()}`);

पैरामीटर

नामटाइपब्यौरा
titleStringइवेंट का टाइटल
startTimeDateइवेंट के शुरू होने की तारीख और समय
endTimeDateइवेंट के खत्म होने की तारीख और समय
optionsObjectएक JavaScript ऑब्जेक्ट, जो नीचे दिए गए अडवांस पैरामीटर तय करता है

उन्नत पैरामीटर

नामटाइपब्यौरा
descriptionStringइवेंट की जानकारी
locationStringइवेंट की जगह
guestsStringकॉमा लगाकर अलग किए गए ईमेल पतों की सूची, जिन्हें मेहमान के तौर पर जोड़ा जाना चाहिए
sendInvitesBooleanन्योते के ईमेल भेजने हैं या नहीं (डिफ़ॉल्ट: false)

वापसी का टिकट

CalendarEvent — बनाया गया इवेंट

अनुमति देना

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

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

createEventFromDescription(description)

यह फ़्री-फ़ॉर्म में दिए गए ब्यौरे से इवेंट बनाता है.

ब्यौरे में वही फ़ॉर्मैट इस्तेमाल किया जाना चाहिए जो यूज़र इंटरफ़ेस (यूआई) की "जल्दी जोड़ें" सुविधा में इस्तेमाल किया जाता है.

// Creates a new event and logs its ID.
const event = CalendarApp.getDefaultCalendar().createEventFromDescription(
    'Lunch with Mary, Friday at 1PM',
);
Logger.log(`Event ID: ${event.getId()}`);

पैरामीटर

नामटाइपब्यौरा
descriptionStringइवेंट के बारे में जानकारी

वापसी का टिकट

CalendarEvent — बनाया गया इवेंट

अनुमति देना

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

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

createEventSeries(title, startTime, endTime, recurrence)

यह कुकी, नई इवेंट सीरीज़ बनाती है.

// Creates an event series for a team meeting, taking place every Tuesday and
// Thursday in 2013.
const eventSeries = CalendarApp.getDefaultCalendar().createEventSeries(
    'Team Meeting',
    new Date('January 1, 2013 03:00:00 PM EST'),
    new Date('January 1, 2013 04:00:00 PM EST'),
    CalendarApp.newRecurrence()
        .addWeeklyRule()
        .onlyOnWeekdays(
            [CalendarApp.Weekday.TUESDAY, CalendarApp.Weekday.THURSDAY])
        .until(new Date('January 1, 2014')),
);
Logger.log(`Event Series ID: ${eventSeries.getId()}`);

पैरामीटर

नामटाइपब्यौरा
titleStringसीरीज़ में मौजूद इवेंट का टाइटल
startTimeDateसीरीज़ में पहला इवेंट शुरू होने की तारीख और समय
endTimeDateसीरीज़ का पहला इवेंट खत्म होने की तारीख और समय
recurrenceEventRecurrenceइवेंट सीरीज़ के बार-बार होने की सेटिंग

वापसी का टिकट

CalendarEventSeries — बनाई गई इवेंट सीरीज़

अनुमति देना

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

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

createEventSeries(title, startTime, endTime, recurrence, options)

यह कुकी, नई इवेंट सीरीज़ बनाती है.

// Creates an event series for a team meeting, taking place every Tuesday and
// Thursday in 2013.
const eventSeries = CalendarApp.getDefaultCalendar().createEventSeries(
    'Team Meeting',
    new Date('January 1, 2013 03:00:00 PM EST'),
    new Date('January 1, 2013 04:00:00 PM EST'),
    CalendarApp.newRecurrence()
        .addWeeklyRule()
        .onlyOnWeekdays(
            [CalendarApp.Weekday.TUESDAY, CalendarApp.Weekday.THURSDAY])
        .until(new Date('January 1, 2014')),
    {location: 'Conference Room'},
);
Logger.log(`Event Series ID: ${eventSeries.getId()}`);

पैरामीटर

नामटाइपब्यौरा
titleStringसीरीज़ में मौजूद इवेंट का टाइटल
startTimeDateसीरीज़ में पहला इवेंट शुरू होने की तारीख और समय
endTimeDateसीरीज़ का पहला इवेंट खत्म होने की तारीख और समय
recurrenceEventRecurrenceइवेंट सीरीज़ के बार-बार होने की सेटिंग
optionsObjectएक JavaScript ऑब्जेक्ट, जो नीचे दिए गए अडवांस पैरामीटर तय करता है

उन्नत पैरामीटर

नामटाइपब्यौरा
descriptionStringसीरीज़ में शामिल इवेंट की जानकारी
locationStringसीरीज़ के इवेंट की जगह
guestsStringकॉमा लगाकर अलग किए गए ईमेल पतों की सूची, जिन्हें सीरीज़ के इवेंट में मेहमान के तौर पर जोड़ना है
sendInvitesBooleanन्योते के ईमेल भेजने हैं या नहीं (डिफ़ॉल्ट: false)

वापसी का टिकट

CalendarEventSeries — बनाई गई इवेंट सीरीज़

अनुमति देना

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

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

getAllCalendars()

यह उन सभी कैलेंडर को दिखाता है जिनका मालिकाना हक उपयोगकर्ता के पास है या जिनकी उसने सदस्यता ली है.

// Determines how many calendars the user can access.
const calendars = CalendarApp.getAllCalendars();
Logger.log(
    'This user owns or is subscribed to %s calendars.',
    calendars.length,
);

वापसी का टिकट

Calendar[] — वे सभी कैलेंडर जिन्हें उपयोगकर्ता ऐक्सेस कर सकता है

अनुमति देना

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

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

getAllOwnedCalendars()

उपयोगकर्ता के मालिकाना हक वाले सभी कैलेंडर मिलते हैं.

// Determines how many calendars the user owns.
const calendars = CalendarApp.getAllOwnedCalendars();
Logger.log('This user owns %s calendars.', calendars.length);

वापसी का टिकट

Calendar[] — वे सभी कैलेंडर जिन पर उपयोगकर्ता का मालिकाना हक है

अनुमति देना

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

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

getCalendarById(id)

इस तरीके से, दिए गए आईडी वाला कैलेंडर मिलता है.

// Gets the public calendar "US Holidays" by ID.
const calendar = CalendarApp.getCalendarById(
    'en.usa#holiday@group.v.calendar.google.com',
);
Logger.log('The calendar is named "%s".', calendar.getName());

पैरामीटर

नामटाइपब्यौरा
idStringकैलेंडर आईडी

वापसी का टिकट

Calendar|null — दिए गए आईडी वाला कैलेंडर या null. ऐसा तब होता है, जब कैलेंडर मौजूद न हो, उपयोगकर्ता के पास उसका ऐक्सेस न हो या उपयोगकर्ता ने कैलेंडर की सदस्यता न ली हो

अनुमति देना

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

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

getCalendarsByName(name)

यह फ़ंक्शन, दिए गए नाम वाले उन सभी कैलेंडर को दिखाता है जिनका मालिकाना हक उपयोगकर्ता के पास है या जिनकी उसने सदस्यता ली है. नाम केस-सेंसिटिव (बड़े और छोटे अक्षरों में अंतर) नहीं होते हैं.

// Gets the public calendar named "US Holidays".
const calendars = CalendarApp.getCalendarsByName('US Holidays');
Logger.log('Found %s matching calendars.', calendars.length);

पैरामीटर

नामटाइपब्यौरा
nameStringकैलेंडर का नाम

वापसी का टिकट

Calendar[] — इस नाम के वे सभी कैलेंडर जिन्हें उपयोगकर्ता ऐक्सेस कर सकता है

अनुमति देना

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

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

getColor()

कैलेंडर का रंग मिलता है.

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

// Gets the color of the calendar and logs it to the console.
// For the default calendar, you can use CalendarApp.getColor() instead.
const calendarColor = calendar.getColor();
console.log(calendarColor);

वापसी का टिकट

String — हेक्साडेसिमल रंग की स्ट्रिंग ("#rrggbb").

अनुमति देना

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

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

getDefaultCalendar()

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

// Determines the time zone of the user's default calendar.
const calendar = CalendarApp.getDefaultCalendar();
Logger.log(
    'My default calendar is set to the time zone "%s".',
    calendar.getTimeZone(),
);

वापसी का टिकट

Calendar — उपयोगकर्ता का डिफ़ॉल्ट कैलेंडर

अनुमति देना

इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, यहां दिए गए एक या उससे ज़्यादा स्कोप या मिलते-जुलते 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.
// TODO(developer): Replace the ID with your own.
const calendar = CalendarApp.getCalendarById('222larabrown@gmail.com');

// Sets the description of the calendar to 'Test description.'
calendar.setDescription('Test description');

// Gets the description of the calendar and logs it to the console.
// For the default calendar, you can use CalendarApp.getDescription() instead.
const description = calendar.getDescription();
console.log(description);

वापसी का टिकट

String — इस कैलेंडर की जानकारी.

अनुमति देना

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

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

getEventById(iCalId)

इस तरीके से, दिए गए आईडी वाला इवेंट मिलता है. अगर सीरीज़ डिफ़ॉल्ट कैलेंडर के अलावा किसी दूसरे कैलेंडर से जुड़ी है, तो इस तरीके को उस कैलेंडर से कॉल किया जाना चाहिए. getEventById(iCalId) को कॉल करने पर, सिर्फ़ डिफ़ॉल्ट कैलेंडर में मौजूद इवेंट दिखता है.

अगर कई इवेंट, इवेंट सीरीज़ का हिस्सा हैं, तो उनका आईडी एक जैसा हो सकता है. इस मामले में, यह तरीका उस सीरीज़ का सिर्फ़ पहला इवेंट दिखाता है.

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

// Creates an event for the moon landing.
const event = calendar.createEvent(
    'Apollo 11 Landing',
    new Date('July 20, 1969 20:05:00 UTC'),
    new Date('July 20, 1969 20:17:00 UTC'),
);

// Gets the calendar event ID and logs it to the console.
const iCalId = event.getId();
console.log(iCalId);

// Gets the event by its ID and logs the title of the event to the console.
// For the default calendar, you can use CalendarApp.getEventById(iCalId)
// instead.
const myEvent = calendar.getEventById(iCalId);
console.log(myEvent.getTitle());

पैरामीटर

नामटाइपब्यौरा
iCalIdStringइवेंट का आईडी.

वापसी का टिकट

CalendarEvent — दिए गए आईडी वाला इवेंट या null, अगर इवेंट मौजूद नहीं है या उपयोगकर्ता इसे ऐक्सेस नहीं कर सकता.

अनुमति देना

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

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

getEventSeriesById(iCalId)

इस तरीके से, दिए गए आईडी वाली इवेंट सीरीज़ मिलती है. अगर दिया गया आईडी किसी एक CalendarEvent के लिए है, तो सीरीज़ में मौजूद किसी एक इवेंट के साथ CalendarEventSeries दिखाया जाता है. ध्यान दें कि अगर इवेंट सीरीज़, डिफ़ॉल्ट कैलेंडर के अलावा किसी दूसरे कैलेंडर से जुड़ी है, तो इस तरीके को उस CalendarApp से कॉल किया जाना चाहिए. सीधे getEventSeriesById(iCalId) को कॉल करने पर, सिर्फ़ डिफ़ॉल्ट कैलेंडर में मौजूद इवेंट सीरीज़ मिलती है.

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

// Creates an event series for a daily team meeting from 1 PM to 2 PM.
// The series adds the daily event from January 1, 2023 through December 31,
// 2023.
const eventSeries = calendar.createEventSeries(
    'Team meeting',
    new Date('Jan 1, 2023 13:00:00'),
    new Date('Jan 1, 2023 14:00:00'),
    CalendarApp.newRecurrence().addDailyRule().until(new Date('Jan 1, 2024')),
);

// Gets the ID of the event series.
const iCalId = eventSeries.getId();

// Gets the event series by its ID and logs the series title to the console.
// For the default calendar, you can use CalendarApp.getEventSeriesById(iCalId)
// instead.
console.log(calendar.getEventSeriesById(iCalId).getTitle());

पैरामीटर

नामटाइपब्यौरा
iCalIdStringइवेंट सीरीज़ का आईडी.

वापसी का टिकट

CalendarEventSeries — दिए गए आईडी वाली सीरीज़ या null. ऐसा तब होता है, जब सीरीज़ मौजूद न हो या उपयोगकर्ता के पास उसका ऐक्सेस न हो.

अनुमति देना

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

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

getEvents(startTime, endTime)

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

यह तरीका, उन इवेंट को दिखाता है जो दी गई समयावधि के दौरान शुरू होते हैं, समयावधि के दौरान खत्म होते हैं या समयावधि को शामिल करते हैं. अगर कोई टाइम ज़ोन नहीं बताया जाता है, तो समय की वैल्यू को स्क्रिप्ट के टाइम ज़ोन के हिसाब से समझा जाता है. यह कैलेंडर के टाइम ज़ोन से अलग हो सकता है.

// Determines how many events are happening in the next two hours.
const now = new Date();
const twoHoursFromNow = new Date(now.getTime() + 2 * 60 * 60 * 1000);
const events = CalendarApp.getDefaultCalendar().getEvents(now, twoHoursFromNow);
Logger.log(`Number of events: ${events.length}`);

पैरामीटर

नामटाइपब्यौरा
startTimeDateसमयसीमा की शुरुआत
endTimeDateसमयसीमा खत्म होने का समय, शामिल नहीं है

वापसी का टिकट

CalendarEvent[] — समयसीमा के अंदर होने वाले इवेंट

अनुमति देना

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

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

getEvents(startTime, endTime, options)

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

यह तरीका, उन इवेंट को दिखाता है जो दी गई समयावधि के दौरान शुरू होते हैं, समयावधि के दौरान खत्म होते हैं या समयावधि को शामिल करते हैं. अगर कोई टाइम ज़ोन नहीं बताया जाता है, तो समय की वैल्यू को स्क्रिप्ट के टाइम ज़ोन के हिसाब से समझा जाता है. यह कैलेंडर के टाइम ज़ोन से अलग हो सकता है.

ध्यान दें कि author, search या statusFilters पर फ़िल्टर करने की सुविधा, start और max लागू करने के बाद मिलती है. इसका मतलब है कि भले ही अतिरिक्त इवेंट, शर्तों को पूरा करते हों, लेकिन लौटाए गए इवेंट की संख्या max से कम हो सकती है.

// Determines how many events are happening in the next two hours that contain
// the term "meeting".
const now = new Date();
const twoHoursFromNow = new Date(now.getTime() + 2 * 60 * 60 * 1000);
const events = CalendarApp.getDefaultCalendar().getEvents(
    now,
    twoHoursFromNow,
    {search: 'meeting'},
);
Logger.log(`Number of events: ${events.length}`);

पैरामीटर

नामटाइपब्यौरा
startTimeDateसमयसीमा की शुरुआत
endTimeDateसमयसीमा खत्म होने का समय, शामिल नहीं है
optionsObjectएक JavaScript ऑब्जेक्ट, जो नीचे दिए गए अडवांस पैरामीटर तय करता है

उन्नत पैरामीटर

नामटाइपब्यौरा
startIntegerदिखाए जाने वाले पहले इवेंट का इंडेक्स
maxIntegerज़्यादा से ज़्यादा इवेंट वापस लाने की संख्या
authorStringइवेंट बनाने वाले व्यक्ति के हिसाब से नतीजों को फ़िल्टर करने के लिए इस्तेमाल किया गया ईमेल पता
searchStringनतीजों को फ़िल्टर करने के लिए इस्तेमाल की गई फ़ुल-टेक्स्ट सर्च क्वेरी
statusFilters[]GuestStatusनतीजों को फ़िल्टर करने के लिए इस्तेमाल किए गए स्टेटस की एक कैटगरी

वापसी का टिकट

CalendarEvent[] — वे इवेंट जो समयसीमा के अंदर होते हैं और शर्तों को पूरा करते हैं

अनुमति देना

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

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

getEventsForDay(date)

किसी दिए गए दिन होने वाले सभी इवेंट को दिखाता है.

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

ध्यान दें कि Date ऑब्जेक्ट के सिर्फ़ तारीख वाले हिस्से का इस्तेमाल किया जाता है. समय वाले हिस्से को अनदेखा कर दिया जाता है. तारीख को कैलेंडर के टाइम ज़ोन के हिसाब से, उस दिन की आधी रात से लेकर अगले दिन की आधी रात तक के तौर पर माना जाता है.

// Determines how many events are happening today.
const today = new Date();
const events = CalendarApp.getDefaultCalendar().getEventsForDay(today);
Logger.log(`Number of events: ${events.length}`);

पैरामीटर

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

वापसी का टिकट

CalendarEvent[] — दी गई तारीख पर होने वाले इवेंट

अनुमति देना

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

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

getEventsForDay(date, options)

यह फ़ंक्शन, किसी दिन होने वाले उन सभी इवेंट को दिखाता है जो तय की गई शर्तों को पूरा करते हैं.

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

ध्यान दें कि Date ऑब्जेक्ट के सिर्फ़ तारीख वाले हिस्से का इस्तेमाल किया जाता है. समय वाले हिस्से को अनदेखा कर दिया जाता है. तारीख को कैलेंडर के टाइम ज़ोन के हिसाब से, उस दिन की आधी रात से लेकर अगले दिन की आधी रात तक के तौर पर माना जाता है.

ध्यान दें कि author, search या statusFilters पर फ़िल्टर करने की सुविधा, start और max लागू करने के बाद मिलती है. इसका मतलब है कि भले ही अतिरिक्त इवेंट, शर्तों को पूरा करते हों, लेकिन लौटाए गए इवेंट की संख्या max से कम हो सकती है.

// Determines how many events are happening today and contain the term
// "meeting".
const today = new Date();
const events = CalendarApp.getDefaultCalendar().getEventsForDay(today, {
  search: 'meeting',
});
Logger.log(`Number of events: ${events.length}`);

पैरामीटर

नामटाइपब्यौरा
dateDateवह तारीख जिसके लिए इवेंट वापस पाने हैं (सिर्फ़ दिन का इस्तेमाल किया जाता है; समय को अनदेखा किया जाता है)
optionsObjectफ़िल्टर करने के बेहतर विकल्प

उन्नत पैरामीटर

नामटाइपब्यौरा
startIntegerदिखाए जाने वाले पहले इवेंट का इंडेक्स
maxIntegerज़्यादा से ज़्यादा इवेंट वापस लाने की संख्या
authorStringइवेंट बनाने वाले व्यक्ति के हिसाब से नतीजों को फ़िल्टर करने के लिए इस्तेमाल किया गया ईमेल पता
searchStringनतीजों को फ़िल्टर करने के लिए इस्तेमाल की गई फ़ुल-टेक्स्ट सर्च क्वेरी
statusFilters[]GuestStatusनतीजों को फ़िल्टर करने के लिए इस्तेमाल किए गए स्टेटस की एक कैटगरी

वापसी का टिकट

CalendarEvent[] — दी गई तारीख पर होने वाले और शर्तों से मेल खाने वाले इवेंट

अनुमति देना

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

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

getId()

इस कुकी से कैलेंडर का आईडी मिलता है. किसी उपयोगकर्ता के डिफ़ॉल्ट कैलेंडर का आईडी, उसका ईमेल पता होता है.

// Opens the calendar by its ID.
// To get the user's default calendar, use CalendarApp.getDefaultCalendar().
// TODO(developer): Replace the ID with your own.
const calendar = CalendarApp.getCalendarById('222larabrown@gmail.com');

// Gets the ID of the calendar and logs it to the console.
const calendarId = calendar.getId();
console.log(calendarId);

वापसी का टिकट

String — कैलेंडर का आईडी.

अनुमति देना

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

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

getName()

कैलेंडर का नाम मिलता है.

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

// Gets the name of the calendar and logs it to the console.
// For the default calendar, you can use CalendarApp.getName() instead.
const calendarName = calendar.getName();
console.log(calendarName);

वापसी का टिकट

String — इस कैलेंडर का नाम.

अनुमति देना

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

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

getOwnedCalendarById(id)

अगर उपयोगकर्ता के पास दिए गए आईडी वाला कैलेंडर है, तो उसे मिलता है.

कैलेंडर आईडी ढूंढने के लिए, Google Calendar में कैलेंडर के नाम के बगल में मौजूद ऐरो पर क्लिक करें. इसके बाद, कैलेंडर की सेटिंग को चुनें. यह आईडी, सेटिंग पेज पर सबसे नीचे दिखता है.

// Gets a (non-existent) private calendar by ID.
const calendar = CalendarApp.getOwnedCalendarById(
    '123456789@group.calendar.google.com',
);
Logger.log('The calendar is named "%s".', calendar.getName());

पैरामीटर

नामटाइपब्यौरा
idStringकैलेंडर आईडी

वापसी का टिकट

Calendar|null — दिए गए आईडी वाला कैलेंडर या null, अगर कैलेंडर मौजूद नहीं है या उपयोगकर्ता के पास इसका मालिकाना हक नहीं है

अनुमति देना

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

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

getOwnedCalendarsByName(name)

उपयोगकर्ता के मालिकाना हक वाले, दिए गए नाम के सभी कैलेंडर पाएं. नाम केस-सेंसिटिव नहीं होते हैं.

// Gets a private calendar named "Travel Plans".
const calendars = CalendarApp.getOwnedCalendarsByName('Travel Plans');
Logger.log('Found %s matching calendars.', calendars.length);

पैरामीटर

नामटाइपब्यौरा
nameStringकैलेंडर का नाम

वापसी का टिकट

Calendar[] — इस नाम के वे सभी कैलेंडर जिनका मालिकाना हक उपयोगकर्ता के पास है

अनुमति देना

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

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

getTimeZone()

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

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

// Gets the time zone of the calendar and logs it to the console.
// For the default calendar, you can use CalendarApp.getTimeZone() instead.
const timeZone = calendar.getTimeZone();
console.log(timeZone);

वापसी का टिकट

String — समय क्षेत्र, जिसे "long" फ़ॉर्मैट में तय किया गया है. उदाहरण के लिए, Joda.org की सूची के मुताबिक, "America/New_York".

अनुमति देना

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

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

isHidden()

इस कुकी से यह तय होता है कि कैलेंडर को यूज़र इंटरफ़ेस में छिपाया गया है या नहीं.

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

// Determines whether the calendar is hidden in the user interface and logs it
// to the console. For the default calendar, you can use CalendarApp.isHidden()
// instead.
const isHidden = calendar.isHidden();
console.log(isHidden);

वापसी का टिकट

Booleantrue अगर कैलेंडर को यूज़र इंटरफ़ेस में छिपाया गया है; false अगर ऐसा नहीं है.

अनुमति देना

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

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

isMyPrimaryCalendar()

इस कुकी से यह पता चलता है कि कैलेंडर, उपयोगकर्ता का मुख्य कैलेंडर है या नहीं.

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

// Determines whether the calendar is the default calendar for
// the effective user and logs it to the console.
// For the default calendar, you can use CalendarApp.isMyPrimaryCalendar()
// instead.
const isMyPrimaryCalendar = calendar.isMyPrimaryCalendar();
console.log(isMyPrimaryCalendar);

वापसी का टिकट

Booleantrue अगर कैलेंडर, उपयोगकर्ता के लिए डिफ़ॉल्ट कैलेंडर है; false अगर ऐसा नहीं है.

अनुमति देना

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

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

isOwnedByMe()

यह कुकी यह तय करती है कि कैलेंडर का मालिकाना हक आपके पास है या नहीं.

// Gets a calendar by its ID. To get the user's default calendar, use
// CalendarApp.getDefault() instead.
// TODO(developer): Replace the ID with the calendar ID that you want to use.
const calendar = CalendarApp.getCalendarById(
    'abc123456@group.calendar.google.com',
);

// Determines whether the calendar is owned by you and logs it.
console.log(calendar.isOwnedByMe());

वापसी का टिकट

Booleantrue अगर कैलेंडर का मालिकाना हक आपके पास है; false अगर नहीं है.

अनुमति देना

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

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

isSelected()

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

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

// Determines whether the calendar's events are displayed in the user interface
// and logs it.
console.log(calendar.isSelected());

वापसी का टिकट

Booleantrue अगर कैलेंडर के इवेंट, यूज़र इंटरफ़ेस में दिखते हैं; false अगर नहीं दिखते हैं

अनुमति देना

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

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

newRecurrence()

यह एक नया recurrence ऑब्जेक्ट बनाता है. इसका इस्तेमाल, इवेंट के बार-बार होने के नियम बनाने के लिए किया जा सकता है.

// Creates an event series for a no-meetings day, taking place every Wednesday
// in 2013.
const recurrence = CalendarApp.newRecurrence()
                       .addWeeklyRule()
                       .onlyOnWeekday(CalendarApp.Weekday.WEDNESDAY)
                       .until(new Date('January 1, 2014'));
const eventSeries = CalendarApp.getDefaultCalendar().createAllDayEventSeries(
    'No Meetings',
    new Date('January 2, 2013 03:00:00 PM EST'),
    recurrence,
);
Logger.log(`Event Series ID: ${eventSeries.getId()}`);

वापसी का टिकट

EventRecurrence — बार-बार होने वाला नया ऑब्जेक्ट, जिसमें कोई नियम सेट नहीं किया गया है (यह हर हफ़्ते में एक बार होने वाले इवेंट की तरह काम करता है)

अनुमति देना

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

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

setColor(color)

इससे कैलेंडर का रंग सेट किया जाता है.

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

// Sets the color of the calendar to pink using the Calendar Color enum.
// For the default calendar, you can use CalendarApp.setColor() instead.
calendar.setColor(CalendarApp.Color.PINK);

पैरामीटर

नामटाइपब्यौरा
colorStringCalendarApp.Color या हेक्साडेसिमल कलर स्ट्रिंग ("#rrggbb").

वापसी का टिकट

Calendar — यह कैलेंडर, चेन बनाने के लिए है.

अनुमति देना

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

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

setDescription(description)

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

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

// Sets the description of the calendar.
// TODO(developer): Update the string with the description that you want to use.
calendar.setDescription('Updated calendar description.');

पैरामीटर

नामटाइपब्यौरा
descriptionStringइस कैलेंडर की जानकारी

वापसी का टिकट

Calendar — यह कैलेंडर, चेन बनाने के लिए है

अनुमति देना

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

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

setHidden(hidden)

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

पैरामीटर

नामटाइपब्यौरा
hiddenBooleanयूज़र इंटरफ़ेस में कैलेंडर को छिपाने के लिए true; इसे दिखाने के लिए false

वापसी का टिकट

Calendar — यह कैलेंडर, चेन बनाने के लिए है

अनुमति देना

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

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

setName(name)

यह कुकी, कैलेंडर का नाम सेट करती है.

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

// Sets the name of the calendar.
// TODO(developer): Update the string with the name that you want to use.
calendar.setName('Example calendar name');

पैरामीटर

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

वापसी का टिकट

Calendar — यह कैलेंडर, चेन बनाने के लिए है

अनुमति देना

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

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

setSelected(selected)

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

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

// Selects the calendar so that its events are displayed in the user interface.
// To unselect the calendar, set the parameter to false.
calendar.setSelected(true);

पैरामीटर

नामटाइपब्यौरा
selectedBooleantrue यूज़र इंटरफ़ेस में कैलेंडर के इवेंट दिखाने के लिए; false उन्हें छिपाने के लिए

वापसी का टिकट

Calendar — यह कैलेंडर, चेन बनाने के लिए है

अनुमति देना

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

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

setTimeZone(timeZone)

कैलेंडर का टाइम ज़ोन सेट करता है.

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

// Sets the time zone of the calendar to America/New York (US/Eastern) time.
calendar.setTimeZone('America/New_York');

पैरामीटर

नामटाइपब्यौरा
timeZoneStringसमय क्षेत्र, जिसे "long" फ़ॉर्मैट में बताया गया है. जैसे, Joda.org में दिया गया "America/New_York".

वापसी का टिकट

Calendar — यह कैलेंडर, चेन बनाने के लिए है.

अनुमति देना

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

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

subscribeToCalendar(id)

अगर उपयोगकर्ता को सदस्यता लेने की अनुमति है, तो यह फ़ंक्शन उसे दिए गए आईडी वाले कैलेंडर की सदस्यता दिलाता है.

// Subscribe to the calendar "US Holidays".
const calendar = CalendarApp.subscribeToCalendar(
    'en.usa#holiday@group.v.calendar.google.com',
);
Logger.log('Subscribed to the calendar "%s".', calendar.getName());

पैरामीटर

नामटाइपब्यौरा
idStringजिस कैलेंडर की सदस्यता लेनी है उसका आईडी

वापसी का टिकट

Calendar — यह वह कैलेंडर है जिसकी आपने अभी सदस्यता ली है

थ्रॉ

Error — अगर इस आईडी वाला कोई कैलेंडर मौजूद नहीं है

अनुमति देना

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

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

subscribeToCalendar(id, options)

अगर उपयोगकर्ता को सदस्यता लेने की अनुमति है, तो यह फ़ंक्शन उसे दिए गए आईडी वाले कैलेंडर की सदस्यता दिलाता है.

// Subscribe to the calendar "US Holidays", and set it to the color blue.
const calendar = CalendarApp.subscribeToCalendar(
    'en.usa#holiday@group.v.calendar.google.com',
    {color: CalendarApp.Color.BLUE},
);
Logger.log('Subscribed to the calendar "%s".', calendar.getName());

पैरामीटर

नामटाइपब्यौरा
idStringउस कैलेंडर का आईडी जिसकी सदस्यता लेनी है.
optionsObjectयह एक JavaScript ऑब्जेक्ट है. इसमें नीचे दिए गए अडवांस पैरामीटर शामिल होते हैं.

उन्नत पैरामीटर

नामटाइपब्यौरा
colorStringरंग के हेक्साडेसिमल कोड की स्ट्रिंग ("#rrggbb") या CalendarApp.Colors से कोई वैल्यू.
hiddenBooleanक्या कैलेंडर को यूज़र इंटरफ़ेस में छिपाया गया है (डिफ़ॉल्ट: false).
selectedBooleanइससे पता चलता है कि कैलेंडर के इवेंट, उपयोगकर्ता इंटरफ़ेस में दिखते हैं या नहीं. डिफ़ॉल्ट रूप से: अगर color भी तय किया गया है, तो true. अगर color तय नहीं किया गया है, तो false.

वापसी का टिकट

Calendar — यह वह कैलेंडर है जिसकी आपने अभी-अभी सदस्यता ली है.

थ्रॉ

Error — अगर इस आईडी वाला कोई कैलेंडर मौजूद नहीं है

अनुमति देना

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

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