वह कैलेंडर दिखाता है जिसका मालिकाना हक उपयोगकर्ता के पास होता है या जिसके पास उसकी सदस्यता होती है.
तरीके
तरीका | रिटर्न टाइप | संक्षिप्त विवरण |
---|---|---|
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 | पूरे दिन चलने वाले इवेंट की नई सीरीज़ बनाता है. |
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 | नई इवेंट सीरीज़ बनाता है. |
deleteCalendar() | void | कैलेंडर को हमेशा के लिए मिटा देता है. |
getColor() | String | कैलेंडर का रंग दिखाता है. |
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 | कैलेंडर का नाम पाता है. |
getTimeZone() | String | कैलेंडर का टाइम ज़ोन मिलता है. |
isHidden() | Boolean | तय करता है कि कैलेंडर यूज़र इंटरफ़ेस में छिपा है या नहीं. |
isMyPrimaryCalendar() | Boolean | इससे पता चलता है कि असरदार उपयोगकर्ता के लिए कैलेंडर मुख्य कैलेंडर है या नहीं. |
isOwnedByMe() | Boolean | इससे पता चलता है कि कैलेंडर पर आपका मालिकाना हक है या नहीं. |
isSelected() | Boolean | तय करता है कि कैलेंडर के इवेंट यूज़र इंटरफ़ेस में दिखाए जाते हैं या नहीं. |
setColor(color) | Calendar | कैलेंडर का रंग सेट करता है. |
setDescription(description) | Calendar | कैलेंडर की जानकारी सेट करता है. |
setHidden(hidden) | Calendar | सेट करता है कि कैलेंडर उपयोगकर्ता इंटरफ़ेस में दिखाई दे या नहीं. |
setName(name) | Calendar | कैलेंडर का नाम सेट करता है. |
setSelected(selected) | Calendar | सेट करता है कि कैलेंडर के इवेंट उपयोगकर्ता इंटरफ़ेस में दिखाए जाएं या नहीं. |
setTimeZone(timeZone) | Calendar | कैलेंडर का टाइम ज़ोन सेट करता है. |
unsubscribeFromCalendar() | void | कैलेंडर की उपयोगकर्ता की सदस्यता छोड़ता है. |
ज़्यादा जानकारी के साथ दस्तावेज़
createAllDayEvent(title, date)
पूरे दिन का नया इवेंट बनाता है.
// Creates an all-day event for the moon landing and logs the ID. var event = CalendarApp.getDefaultCalendar().createAllDayEvent('Apollo 11 Landing', new Date('July 20, 1969')); Logger.log('Event ID: ' + event.getId());
पैरामीटर
नाम | Type | ब्यौरा |
---|---|---|
title | String | इवेंट का शीर्षक. |
date | Date | इवेंट की तारीख (सिर्फ़ दिन का इस्तेमाल किया जाता है, समय को अनदेखा किया जाता है). |
रिटर्न
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. var event = CalendarApp.getDefaultCalendar().createAllDayEvent('Woodstock Festival', new Date('August 15, 1969'), new Date('August 18, 1969')); Logger.log('Event ID: ' + event.getId());
पैरामीटर
नाम | Type | ब्यौरा |
---|---|---|
title | String | इवेंट का शीर्षक. |
startDate | Date | इवेंट शुरू होने की तारीख (सिर्फ़ दिन का इस्तेमाल किया जाता है; समय को अनदेखा किया जाता है). |
endDate | Date | इवेंट खत्म होने की तारीख (सिर्फ़ दिन का इस्तेमाल किया जाता है; समय को अनदेखा किया जाता है). खत्म होने की तारीख खास होती है. |
रिटर्न
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. var 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());
पैरामीटर
नाम | Type | ब्यौरा |
---|---|---|
title | String | इवेंट का शीर्षक. |
startDate | Date | इवेंट शुरू होने की तारीख (सिर्फ़ दिन का इस्तेमाल किया जाता है; समय को अनदेखा किया जाता है). |
endDate | Date | इवेंट खत्म होने की तारीख (सिर्फ़ दिन का इस्तेमाल किया जाता है; समय को अनदेखा किया जाता है). खत्म होने की तारीख खास होती है. |
options | Object | बेहतर पैरामीटर के बारे में बताने वाला JavaScript ऑब्जेक्ट, जैसा कि नीचे दिया गया है. |
उन्नत पैरामीटर
नाम | Type | ब्यौरा |
---|---|---|
description | String | इवेंट के बारे में जानकारी. |
location | String | इवेंट की जगह. |
guests | String | उन ईमेल पतों की ऐसी सूची जिन्हें कॉमा लगाकर अलग किया गया है जिन्हें मेहमान के तौर पर जोड़ा जाना चाहिए. |
sendInvites | Boolean | न्योते के ईमेल भेजना है या नहीं (डिफ़ॉल्ट: 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. var event = CalendarApp.getDefaultCalendar().createAllDayEvent('Apollo 11 Landing', new Date('July 20, 1969'), {location: 'The Moon'}); Logger.log('Event ID: ' + event.getId());
पैरामीटर
नाम | Type | ब्यौरा |
---|---|---|
title | String | इवेंट का शीर्षक. |
date | Date | इवेंट की तारीख (सिर्फ़ दिन का इस्तेमाल किया जाता है, समय को अनदेखा किया जाता है). |
options | Object | बेहतर पैरामीटर के बारे में बताने वाला JavaScript ऑब्जेक्ट, जैसा कि नीचे दिया गया है. |
उन्नत पैरामीटर
नाम | Type | ब्यौरा |
---|---|---|
description | String | इवेंट के बारे में जानकारी. |
location | String | इवेंट की जगह. |
guests | String | उन ईमेल पतों की ऐसी सूची जिन्हें कॉमा लगाकर अलग किया गया है जिन्हें मेहमान के तौर पर जोड़ा जाना चाहिए. |
sendInvites | Boolean | न्योते के ईमेल भेजना है या नहीं (डिफ़ॉल्ट: 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. var 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());
पैरामीटर
नाम | Type | ब्यौरा |
---|---|---|
title | String | सीरीज़ में मौजूद इवेंट का टाइटल |
startDate | Date | सीरीज़ में पहले इवेंट की तारीख (सिर्फ़ दिन का इस्तेमाल किया जाता है; समय को अनदेखा किया जाता है) |
recurrence | EventRecurrence | इवेंट सीरीज़ की बार-बार होने वाली सेटिंग |
रिटर्न
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. var 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());
पैरामीटर
नाम | Type | ब्यौरा |
---|---|---|
title | String | सीरीज़ में मौजूद इवेंट का टाइटल |
startDate | Date | सीरीज़ में पहले इवेंट की तारीख (सिर्फ़ दिन का इस्तेमाल किया जाता है; समय को अनदेखा किया जाता है) |
recurrence | EventRecurrence | इवेंट सीरीज़ की बार-बार होने वाली सेटिंग |
options | Object | यह एक JavaScript ऑब्जेक्ट है, जो बेहतर पैरामीटर के बारे में बताता है, जैसा कि नीचे दिया गया है |
उन्नत पैरामीटर
नाम | Type | ब्यौरा |
---|---|---|
description | String | सीरीज़ में मौजूद इवेंट का ब्यौरा |
location | String | सीरीज़ में मौजूद इवेंट की जगह |
guests | String | ईमेल पतों की कॉमा-सेपरेटेड लिस्ट, जिन्हें सीरीज़ के इवेंट में मेहमानों के तौर पर जोड़ा जाना चाहिए |
sendInvites | Boolean | न्योते के ईमेल भेजना है या नहीं (डिफ़ॉल्ट: false ) |
रिटर्न
CalendarEventSeries
— बनाई गई इवेंट सीरीज़
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट को, इनमें से एक या उससे ज़्यादा स्कोप या मिलते-जुलते 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. var 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());
पैरामीटर
नाम | Type | ब्यौरा |
---|---|---|
title | String | इवेंट का टाइटल |
startTime | Date | इवेंट शुरू होने की तारीख और समय |
endTime | Date | इवेंट खत्म होने की तारीख और समय |
रिटर्न
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. var 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());
पैरामीटर
नाम | Type | ब्यौरा |
---|---|---|
title | String | इवेंट का टाइटल |
startTime | Date | इवेंट शुरू होने की तारीख और समय |
endTime | Date | इवेंट खत्म होने की तारीख और समय |
options | Object | यह एक JavaScript ऑब्जेक्ट है, जो बेहतर पैरामीटर के बारे में बताता है, जैसा कि नीचे दिया गया है |
उन्नत पैरामीटर
नाम | Type | ब्यौरा |
---|---|---|
description | String | इवेंट की जानकारी |
location | String | इवेंट की जगह |
guests | String | उन ईमेल पतों की सूची जिन्हें कॉमा लगाकर अलग किया गया है जिन्हें मेहमान के तौर पर जोड़ा जाना चाहिए |
sendInvites | Boolean | न्योते के ईमेल भेजना है या नहीं (डिफ़ॉल्ट: false ) |
रिटर्न
CalendarEvent
— बनाया गया इवेंट
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट को, इनमें से एक या उससे ज़्यादा स्कोप या मिलते-जुलते REST API के सही स्कोप की मदद से अनुमति देना ज़रूरी होता है:
-
https://www.googleapis.com/auth/calendar
-
https://www.google.com/calendar/feeds
createEventFromDescription(description)
फ़्री फ़ॉर्म ब्यौरे से इवेंट बनाता है.
ब्यौरे को उसी फ़ॉर्मैट का इस्तेमाल करना चाहिए जो यूज़र इंटरफ़ेस (यूआई) की "Quick Add" सुविधा के लिए इस्तेमाल किया गया है.
// Creates a new event and logs its ID. var event = CalendarApp.getDefaultCalendar() .createEventFromDescription('Lunch with Mary, Friday at 1PM'); Logger.log('Event ID: ' + event.getId());
पैरामीटर
नाम | Type | ब्यौरा |
---|---|---|
description | String | इवेंट के बारे में बिना किसी शुल्क के जानकारी दें |
रिटर्न
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. var 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());
पैरामीटर
नाम | Type | ब्यौरा |
---|---|---|
title | String | सीरीज़ में मौजूद इवेंट का टाइटल |
startTime | Date | सीरीज़ का पहला इवेंट शुरू होने की तारीख और समय |
endTime | Date | सीरीज़ का पहला इवेंट खत्म होने की तारीख और समय |
recurrence | EventRecurrence | इवेंट सीरीज़ की बार-बार होने वाली सेटिंग |
रिटर्न
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. var 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());
पैरामीटर
नाम | Type | ब्यौरा |
---|---|---|
title | String | सीरीज़ में मौजूद इवेंट का टाइटल |
startTime | Date | सीरीज़ का पहला इवेंट शुरू होने की तारीख और समय |
endTime | Date | सीरीज़ का पहला इवेंट खत्म होने की तारीख और समय |
recurrence | EventRecurrence | इवेंट सीरीज़ की बार-बार होने वाली सेटिंग |
options | Object | यह एक JavaScript ऑब्जेक्ट है, जो बेहतर पैरामीटर के बारे में बताता है, जैसा कि नीचे दिया गया है |
उन्नत पैरामीटर
नाम | Type | ब्यौरा |
---|---|---|
description | String | सीरीज़ में मौजूद इवेंट का ब्यौरा |
location | String | सीरीज़ में मौजूद इवेंट की जगह |
guests | String | ईमेल पतों की कॉमा-सेपरेटेड लिस्ट, जिन्हें सीरीज़ के इवेंट में मेहमानों के तौर पर जोड़ा जाना चाहिए |
sendInvites | Boolean | न्योते के ईमेल भेजना है या नहीं (डिफ़ॉल्ट: false ) |
रिटर्न
CalendarEventSeries
— बनाई गई इवेंट सीरीज़
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट को, इनमें से एक या उससे ज़्यादा स्कोप या मिलते-जुलते REST API के सही स्कोप की मदद से अनुमति देना ज़रूरी होता है:
-
https://www.googleapis.com/auth/calendar
-
https://www.google.com/calendar/feeds
deleteCalendar()
कैलेंडर को हमेशा के लिए मिटा देता है. उपयोगकर्ता सिर्फ़ अपने मालिकाना हक वाले कैलेंडर को मिटा सकता है.
// Creates a calendar to delete. const calendar = CalendarApp.createCalendar('Test'); // Deletes the 'Test' calendar permanently. calendar.deleteCalendar();
थ्रो
Error
— अगर यह इंपोर्ट किया गया कैलेंडर है.
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट को, इनमें से एक या उससे ज़्यादा स्कोप या मिलते-जुलते REST API के सही स्कोप की मदद से अनुमति देना ज़रूरी होता है:
-
https://www.googleapis.com/auth/calendar
-
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
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)
दिए गए आईडी वाले इवेंट की जानकारी देता है. अगर सीरीज़ किसी डिफ़ॉल्ट कैलेंडर के बजाय किसी दूसरे कैलेंडर से जुड़ी है, तो
इस तरीके को उस कैलेंडर से कॉल करना होगा. CalendarApp.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());
पैरामीटर
नाम | Type | ब्यौरा |
---|---|---|
iCalId | String | इवेंट का आईडी. |
रिटर्न
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
दिखता है. ध्यान दें कि अगर
इवेंट सीरीज़ डिफ़ॉल्ट कैलेंडर के बजाय किसी दूसरे कैलेंडर से जुड़ी है, तो इस तरीके को
उस Calendar
से कॉल किया जाना चाहिए. 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());
पैरामीटर
नाम | Type | ब्यौरा |
---|---|---|
iCalId | String | इवेंट सीरीज़ का आईडी. |
रिटर्न
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. var now = new Date(); var twoHoursFromNow = new Date(now.getTime() + (2 * 60 * 60 * 1000)); var events = CalendarApp.getDefaultCalendar().getEvents(now, twoHoursFromNow); Logger.log('Number of events: ' + events.length);
पैरामीटर
नाम | Type | ब्यौरा |
---|---|---|
startTime | Date | समयसीमा की शुरुआत |
endTime | Date | समय सीमा की समाप्ति, जिसमें शामिल नहीं है |
रिटर्न
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)
यह फ़ंक्शन किसी तय समयसीमा में होने वाले सभी इवेंट को ऐक्सेस करता है और ज़रूरी शर्तों को पूरा करता है.
यह तरीका उन इवेंट को दिखाता है जो दी गई समयसीमा के दौरान शुरू होते हैं, समय सीमा के दौरान खत्म होते हैं या जिनमें समयसीमा शामिल होती है. अगर कोई समय क्षेत्र बताया नहीं गया है, तो समय मानों को स्क्रिप्ट के समय क्षेत्र के संदर्भ में समझा जाएगा, जो कि कैलेंडर के समय क्षेत्र से अलग हो सकता है.
ध्यान रखें कि start
और max
को लागू करने के बाद, author
, search
या statusFilters
पर फ़िल्टर लागू होता है. इसका मतलब है कि लौटाए गए इवेंट की संख्या max
से कम हो सकती है. भले ही, अतिरिक्त इवेंट शर्तें पूरी करते हों.
// Determines how many events are happening in the next two hours that contain the term // "meeting". var now = new Date(); var twoHoursFromNow = new Date(now.getTime() + (2 * 60 * 60 * 1000)); var events = CalendarApp.getDefaultCalendar().getEvents(now, twoHoursFromNow, {search: 'meeting'}); Logger.log('Number of events: ' + events.length);
पैरामीटर
नाम | Type | ब्यौरा |
---|---|---|
startTime | Date | समयसीमा की शुरुआत |
endTime | Date | समय सीमा की समाप्ति, जिसमें शामिल नहीं है |
options | Object | यह एक JavaScript ऑब्जेक्ट है, जो बेहतर पैरामीटर के बारे में बताता है, जैसा कि नीचे दिया गया है |
उन्नत पैरामीटर
नाम | Type | ब्यौरा |
---|---|---|
start | Integer | रिटर्न किए जाने वाले पहले इवेंट का इंडेक्स |
max | Integer | लौटाए जाने वाले इवेंट की ज़्यादा से ज़्यादा संख्या |
author | String | इवेंट बनाने वाले व्यक्ति के नतीजों को फ़िल्टर करने के लिए इस्तेमाल किया जाने वाला ईमेल पता |
search | String | नतीजों को फ़िल्टर करने के लिए इस्तेमाल की जाने वाली पूरे टेक्स्ट वाली खोज क्वेरी |
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)
किसी दिए गए दिन होने वाले सभी इवेंट की जानकारी देता है.
इस तरीके से इवेंट तब दिखते हैं, जब वे किसी दिन में शुरू होते हैं, दिन के खत्म होते हैं या जिनमें उस दिन शामिल होता है.
ध्यान दें कि तारीख ऑब्जेक्ट का सिर्फ़ तारीख वाला हिस्सा इस्तेमाल किया जाता है. समय वाले हिस्से को अनदेखा कर दिया जाता है. कैलेंडर के टाइम ज़ोन में तारीख को उस दिन की आधी रात से अगले दिन की आधी रात तक के रूप में समझा जाता है.
// Determines how many events are happening today. var today = new Date(); var events = CalendarApp.getDefaultCalendar().getEventsForDay(today); Logger.log('Number of events: ' + events.length);
पैरामीटर
नाम | Type | ब्यौरा |
---|---|---|
date | Date | वह तारीख जिसके लिए इवेंट फिर से पाना है (सिर्फ़ दिन का इस्तेमाल किया जाता है; समय को अनदेखा कर दिया जाता है) |
रिटर्न
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)
किसी दिए गए दिन होने वाले सभी इवेंट की जानकारी देता है और तय की गई शर्तों को पूरा करता है.
इस तरीके से इवेंट तब दिखते हैं, जब वे किसी दिन में शुरू होते हैं, दिन के खत्म होते हैं या जिनमें उस दिन शामिल होता है.
ध्यान दें कि तारीख ऑब्जेक्ट का सिर्फ़ तारीख वाला हिस्सा इस्तेमाल किया जाता है. समय वाले हिस्से को अनदेखा कर दिया जाता है. कैलेंडर के टाइम ज़ोन में तारीख को उस दिन की आधी रात से अगले दिन की आधी रात तक के रूप में समझा जाता है.
ध्यान रखें कि start
और max
को लागू करने के बाद, author
, search
या statusFilters
पर फ़िल्टर लागू होता है. इसका मतलब है कि लौटाए गए इवेंट की संख्या max
से कम हो सकती है. भले ही, अतिरिक्त इवेंट शर्तें पूरी करते हों.
// Determines how many events are happening today and contain the term "meeting". var today = new Date(); var events = CalendarApp.getDefaultCalendar().getEventsForDay(today, {search: 'meeting'}); Logger.log('Number of events: ' + events.length);
पैरामीटर
नाम | Type | ब्यौरा |
---|---|---|
date | Date | वह तारीख जिसके लिए इवेंट फिर से पाना है (सिर्फ़ दिन का इस्तेमाल किया जाता है; समय को अनदेखा कर दिया जाता है) |
options | Object | फ़िल्टर करने के बेहतर विकल्प |
उन्नत पैरामीटर
नाम | Type | ब्यौरा |
---|---|---|
start | Integer | रिटर्न किए जाने वाले पहले इवेंट का इंडेक्स |
max | Integer | लौटाए जाने वाले इवेंट की ज़्यादा से ज़्यादा संख्या |
author | String | इवेंट बनाने वाले व्यक्ति के नतीजों को फ़िल्टर करने के लिए इस्तेमाल किया जाने वाला ईमेल पता |
search | String | नतीजों को फ़िल्टर करने के लिए इस्तेमाल की जाने वाली पूरे टेक्स्ट वाली खोज क्वेरी |
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
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
— टाइम ज़ोन, जिसे "लंबा" फ़ॉर्मैट में दिखाया जाता है (उदाहरण के लिए, "America/New_York", जैसा कि
Joda.org) में बताया गया है.
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट को, इनमें से एक या उससे ज़्यादा स्कोप या मिलते-जुलते 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);
रिटर्न
Boolean
— अगर कैलेंडर यूज़र इंटरफ़ेस में छिपा है, तो true
; अगर कैलेंडर नहीं है, तो 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);
रिटर्न
Boolean
— true
अगर कैलेंडर, असरदार उपयोगकर्ता के लिए डिफ़ॉल्ट कैलेंडर है; अगर नहीं है, तो false
.
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट को, इनमें से एक या उससे ज़्यादा स्कोप या मिलते-जुलते REST API के सही स्कोप की मदद से अनुमति देना ज़रूरी होता है:
-
https://www.googleapis.com/auth/calendar
-
https://www.googleapis.com/auth/calendar.readonly
-
https://www.google.com/calendar/feeds
isOwnedByMe()
इससे पता चलता है कि कैलेंडर पर आपका मालिकाना हक है या नहीं.
// 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());
रिटर्न
Boolean
— true
अगर कैलेंडर का मालिकाना हक आपके पास है, तो 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());
रिटर्न
Boolean
— true
, अगर कैलेंडर के इवेंट यूज़र इंटरफ़ेस में दिखते हैं, तो false
अगर नहीं
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट को, इनमें से एक या उससे ज़्यादा स्कोप या मिलते-जुलते 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);
पैरामीटर
नाम | Type | ब्यौरा |
---|---|---|
color | String | CalendarApp.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.')
पैरामीटर
नाम | Type | ब्यौरा |
---|---|---|
description | String | इस कैलेंडर का ब्यौरा |
रिटर्न
Calendar
— यह कैलेंडर चेन बनाने के लिए है
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट को, इनमें से एक या उससे ज़्यादा स्कोप या मिलते-जुलते REST API के सही स्कोप की मदद से अनुमति देना ज़रूरी होता है:
-
https://www.googleapis.com/auth/calendar
-
https://www.google.com/calendar/feeds
setHidden(hidden)
सेट करता है कि कैलेंडर उपयोगकर्ता इंटरफ़ेस में दिखाई दे या नहीं.
पैरामीटर
नाम | Type | ब्यौरा |
---|---|---|
hidden | Boolean | यूज़र इंटरफ़ेस में कैलेंडर छिपाने के लिए 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');
पैरामीटर
नाम | Type | ब्यौरा |
---|---|---|
name | String | नया नाम |
रिटर्न
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);
पैरामीटर
नाम | Type | ब्यौरा |
---|---|---|
selected | Boolean | यूज़र इंटरफ़ेस में कैलेंडर के इवेंट दिखाने के लिए true ; उन्हें छिपाने के लिए 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');
पैरामीटर
नाम | Type | ब्यौरा |
---|---|---|
timeZone | String | टाइम ज़ोन, जिसे "लंबा" फ़ॉर्मैट में दिखाया जाता है (जैसे कि "America/New_York", जैसा कि Joda.org में बताया गया है). |
रिटर्न
Calendar
— यह कैलेंडर चेन बनाने के लिए है.
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट को, इनमें से एक या उससे ज़्यादा स्कोप या मिलते-जुलते REST API के सही स्कोप की मदद से अनुमति देना ज़रूरी होता है:
-
https://www.googleapis.com/auth/calendar
-
https://www.google.com/calendar/feeds
unsubscribeFromCalendar()
कैलेंडर की उपयोगकर्ता की सदस्यता छोड़ता है. उपयोगकर्ता, मेरे कैलेंडर सूची में दिए गए कैलेंडर की सदस्यता नहीं छोड़ सकता. वे अन्य कैलेंडर में दिए गए कैलेंडर की सदस्यता छोड़ सकते हैं.
// Gets the calendar by its ID. // TODO(developer): Replace the calendar ID with the calendar ID that you want to get. const calendar = CalendarApp.getCalendarById('abc123456@group.calendar.google.com'); // Unsubscribes the user from the calendar. const result = calendar.unsubscribeFromCalendar();
थ्रो
Error
— अगर यह कैलेंडर का मालिकाना हक है
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट को, इनमें से एक या उससे ज़्यादा स्कोप या मिलते-जुलते REST API के सही स्कोप की मदद से अनुमति देना ज़रूरी होता है:
-
https://www.googleapis.com/auth/calendar
-
https://www.google.com/calendar/feeds