Class CalendarEventSeries

CalendarEventSeries

Reprezentuje serię wydarzeń (wydarzenie cykliczne).

Metody

MetodaZwracany typKrótki opis
addEmailReminder(minutesBefore)CalendarEventSeriesDodaje do wydarzenia nowego e-maila z przypomnieniem.
addGuest(email)CalendarEventSeriesDodaje gościa do wydarzenia.
addPopupReminder(minutesBefore)CalendarEventSeriesDodaje do wydarzenia nowe wyskakujące okienko z powiadomieniem.
addSmsReminder(minutesBefore)CalendarEventSeriesDodaje nowe przypomnienie SMS do wydarzenia.
anyoneCanAddSelf()BooleanOkreśla, czy użytkownicy mogą dodawać siebie jako gości do wydarzenia w Kalendarzu.
deleteEventSeries()voidUsuwa serię wydarzeń.
deleteTag(key)CalendarEventSeriesUsuwa tag klucz/wartość ze zdarzenia.
getAllTagKeys()String[]Pobiera wszystkie klucze tagów, które zostały ustawione dla zdarzenia.
getColor()StringZwraca kolor wydarzenia z kalendarza.
getCreators()String[]Pozyskuje twórców wydarzenia.
getDateCreated()DatePobiera datę utworzenia zdarzenia.
getDescription()StringPobiera opis zdarzenia.
getEmailReminders()Integer[]Pobiera wartości minut dla wszystkich e-maili z przypomnieniami o wydarzeniu.
getGuestByEmail(email)EventGuestPobiera gości na podstawie adresu e-mail.
getGuestList()EventGuest[]Pobiera gości wydarzenia bez jego właściciela.
getGuestList(includeOwner)EventGuest[]Pobiera gości na wydarzenie, w tym jego właścicieli.
getId()StringPobiera unikalny identyfikator IUID wydarzenia.
getLastUpdated()DatePobiera datę ostatniej aktualizacji zdarzenia.
getLocation()StringOkreśla lokalizację wydarzenia.
getMyStatus()GuestStatusPobiera stan wydarzenia (np. bierze udział w wydarzeniu lub zaproszono) użytkownika.
getOriginalCalendarId()StringUzyskaj identyfikator kalendarza, w którym utworzono to wydarzenie.
getPopupReminders()Integer[]Pobiera wartości minut dla wszystkich wyskakujących przypomnień o wydarzeniu.
getSmsReminders()Integer[]Pobiera minuty dla wszystkich przypomnień SMS o wydarzeniu.
getTag(key)StringPobiera wartość tagu zdarzenia.
getTitle()StringPobiera nazwę wydarzenia.
getVisibility()Visibilitypobiera widoczność wydarzenia.
guestsCanInviteOthers()BooleanOkreśla, czy goście mogą zapraszać innych gości.
guestsCanModify()BooleanOkreśla, czy goście mogą modyfikować wydarzenie.
guestsCanSeeGuests()BooleanOkreśla, czy goście mogą widzieć innych gości.
isOwnedByMe()BooleanOkreśla, czy jesteś właścicielem wydarzenia.
removeAllReminders()CalendarEventSeriesUsuwa wszystkie przypomnienia z wydarzenia.
removeGuest(email)CalendarEventSeriesusuwa gościa z wydarzenia.
resetRemindersToDefault()CalendarEventSeriesResetuje przypomnienia przy użyciu domyślnych ustawień kalendarza.
setAnyoneCanAddSelf(anyoneCanAddSelf)CalendarEventSeriesOkreśla, czy goście, którzy nie są gośćmi, mogą dodawać się do wydarzenia.
setColor(color)CalendarEventSeriesUstawia kolor wydarzenia w kalendarzu.
setDescription(description)CalendarEventSeriesUstawia opis zdarzenia.
setGuestsCanInviteOthers(guestsCanInviteOthers)CalendarEventSeriesOkreśla, czy goście mogą zapraszać innych gości.
setGuestsCanModify(guestsCanModify)CalendarEventSeriesOkreśla, czy goście mogą modyfikować wydarzenie.
setGuestsCanSeeGuests(guestsCanSeeGuests)CalendarEventSeriesOkreśla, czy goście mogą widzieć innych gości.
setLocation(location)CalendarEventSeriesSłuży do określania lokalizacji wydarzenia.
setMyStatus(status)CalendarEventSeriesUstawia stan wydarzenia (np. bierze udział w wydarzeniu lub zaproszono) użytkownika.
setRecurrence(recurrence, startDate)CalendarEventSeriesUstawia reguły powtarzania dla serii zdarzeń całodniowych.
setRecurrence(recurrence, startTime, endTime)CalendarEventSeriesUstawia reguły powtarzania dla tej serii zdarzeń.
setTag(key, value)CalendarEventSeriesUstawia w zdarzeniu tag klucz/wartość służący do przechowywania niestandardowych metadanych.
setTitle(title)CalendarEventSeriesUstawia tytuł wydarzenia.
setVisibility(visibility)CalendarEventSeriesUstawia widoczność wydarzenia.

Szczegółowa dokumentacja

addEmailReminder(minutesBefore)

Dodaje do wydarzenia nowego e-maila z przypomnieniem. Przypomnienie musi przypadać co najmniej 5 minut i nie później niż 4 tygodnie (40 320 minut) przed wydarzeniem.

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

Parametry

NazwaTypOpis
minutesBeforeIntegerliczba minut przed wydarzeniem

Powroty

CalendarEventSeries – ten CalendarEventSeries do łańcuchów

Rzuty

Error – jeśli do wydarzenia jest więcej niż 5 przypomnień lub czas jest poza zakresem prawnym.

Upoważnienie

Skrypty korzystające z tej metody wymagają autoryzacji za pomocą powiązanego interfejsu API REST z co najmniej jednym z tych zakresów lub odpowiednich zakresów:

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

addGuest(email)

Dodaje gościa do wydarzenia.

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

Parametry

NazwaTypOpis
emailStringAdres e-mail gościa.

Powroty

CalendarEventSeries – ten element typu CalendarEventSeries do tworzenia łańcuchów.

Upoważnienie

Skrypty korzystające z tej metody wymagają autoryzacji za pomocą powiązanego interfejsu API REST z co najmniej jednym z tych zakresów lub odpowiednich zakresów:

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

addPopupReminder(minutesBefore)

Dodaje do wydarzenia nowe wyskakujące okienko z powiadomieniem. Powiadomienie musi przypadać co najmniej 5 minut i nie później niż 4 tygodnie (40 320 minut) przed wydarzeniem.

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

Parametry

NazwaTypOpis
minutesBeforeIntegerliczba minut przed wydarzeniem

Powroty

CalendarEventSeries – ten CalendarEventSeries do łańcuchów

Upoważnienie

Skrypty korzystające z tej metody wymagają autoryzacji za pomocą powiązanego interfejsu API REST z co najmniej jednym z tych zakresów lub odpowiednich zakresów:

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

addSmsReminder(minutesBefore)

Dodaje nowe przypomnienie SMS do wydarzenia. Przypomnienie musi przypadać co najmniej 5 minut i nie później niż 4 tygodnie (40 320 minut) przed wydarzeniem.

Parametry

NazwaTypOpis
minutesBeforeIntegerliczba minut przed wydarzeniem

Powroty

CalendarEventSeries – ten CalendarEventSeries do łańcuchów

Rzuty

Error – jeśli do wydarzenia jest więcej niż 5 przypomnień lub czas jest poza zakresem prawnym.

Upoważnienie

Skrypty korzystające z tej metody wymagają autoryzacji za pomocą powiązanego interfejsu API REST z co najmniej jednym z tych zakresów lub odpowiednich zakresów:

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

anyoneCanAddSelf()

Określa, czy użytkownicy mogą dodawać siebie jako gości do wydarzenia w Kalendarzu.

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

Powroty

Booleantrue, jeśli osoby niebędące gośćmi mogą samodzielnie dodać się do wydarzenia; false jeśli nie

Upoważnienie

Skrypty korzystające z tej metody wymagają autoryzacji za pomocą powiązanego interfejsu API REST z co najmniej jednym z tych zakresów lub odpowiednich zakresów:

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

deleteEventSeries()

Usuwa serię wydarzeń.

Upoważnienie

Skrypty korzystające z tej metody wymagają autoryzacji za pomocą powiązanego interfejsu API REST z co najmniej jednym z tych zakresów lub odpowiednich zakresów:

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

deleteTag(key)

Usuwa tag klucz/wartość ze zdarzenia.

Parametry

NazwaTypOpis
keyStringklucz tagu

Powroty

CalendarEventSeries – ten CalendarEventSeries do łańcuchów

Upoważnienie

Skrypty korzystające z tej metody wymagają autoryzacji za pomocą powiązanego interfejsu API REST z co najmniej jednym z tych zakresów lub odpowiednich zakresów:

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

getAllTagKeys()

Pobiera wszystkie klucze tagów, które zostały ustawione dla zdarzenia.

Powroty

String[] – tablica kluczy ciągów znaków;

Upoważnienie

Skrypty korzystające z tej metody wymagają autoryzacji za pomocą powiązanego interfejsu API REST z co najmniej jednym z tych zakresów lub odpowiednich zakresów:

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

getColor()

Zwraca kolor wydarzenia z kalendarza.

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

Powroty

String – ciąg znaków reprezentujący kolor zdarzenia w postaci indeksu (1–11) wartości z tabeli CalendarApp.EventColor.

Upoważnienie

Skrypty korzystające z tej metody wymagają autoryzacji za pomocą powiązanego interfejsu API REST z co najmniej jednym z tych zakresów lub odpowiednich zakresów:

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

getCreators()

Pozyskuje twórców wydarzenia.

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

Powroty

String[] – adresy e-mail twórców wydarzenia;

Upoważnienie

Skrypty korzystające z tej metody wymagają autoryzacji za pomocą powiązanego interfejsu API REST z co najmniej jednym z tych zakresów lub odpowiednich zakresów:

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

getDateCreated()

Pobiera datę utworzenia zdarzenia. Musisz mieć dostęp do kalendarza.

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

Powroty

Date – data utworzenia,

Upoważnienie

Skrypty korzystające z tej metody wymagają autoryzacji za pomocą powiązanego interfejsu API REST z co najmniej jednym z tych zakresów lub odpowiednich zakresów:

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

getDescription()

Pobiera opis zdarzenia. Musisz mieć uprawnienia do edycji kalendarza.

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

Powroty

String – opis,

Upoważnienie

Skrypty korzystające z tej metody wymagają autoryzacji za pomocą powiązanego interfejsu API REST z co najmniej jednym z tych zakresów lub odpowiednich zakresów:

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

getEmailReminders()

Pobiera wartości minut dla wszystkich e-maili z przypomnieniami o wydarzeniu. Musisz mieć uprawnienia do edycji kalendarza.

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

Powroty

Integer[] – tablica, w której każda wartość odpowiada liczbie minut poprzedzającej zdarzenie, które zostało aktywowane.

Upoważnienie

Skrypty korzystające z tej metody wymagają autoryzacji za pomocą powiązanego interfejsu API REST z co najmniej jednym z tych zakresów lub odpowiednich zakresów:

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

getGuestByEmail(email)

Pobiera gości na podstawie adresu e-mail.

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

Parametry

NazwaTypOpis
emailStringadres gościa

Powroty

EventGuest – gość lub wartość null, jeśli adres e-mail nie należy do gościa.

Upoważnienie

Skrypty korzystające z tej metody wymagają autoryzacji za pomocą powiązanego interfejsu API REST z co najmniej jednym z tych zakresów lub odpowiednich zakresów:

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

getGuestList()

Pobiera gości wydarzenia bez jego właściciela.

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

Powroty

EventGuest[] – tablica gości;

Upoważnienie

Skrypty korzystające z tej metody wymagają autoryzacji za pomocą powiązanego interfejsu API REST z co najmniej jednym z tych zakresów lub odpowiednich zakresów:

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

getGuestList(includeOwner)

Pobiera gości na wydarzenie, w tym jego właścicieli.

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

Parametry

NazwaTypOpis
includeOwnerBooleanczy właściciel ma być zaproszony jako gość.

Powroty

EventGuest[] – tablica gości;

Upoważnienie

Skrypty korzystające z tej metody wymagają autoryzacji za pomocą powiązanego interfejsu API REST z co najmniej jednym z tych zakresów lub odpowiednich zakresów:

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

getId()

Pobiera unikalny identyfikator IUID wydarzenia. Pamiętaj, że identyfikatory iCalUID i wydarzenie id używane przez interfejs Calendar v3 API i usługa zaawansowana Kalendarza nie są identyczne i nie mogą być stosowane wymiennie. Jedna z różnic w ich semantyce polega na tym, że w przypadku wydarzeń cyklicznych wszystkie wystąpienia jednego zdarzenia mają różne wartości ids, podczas gdy wszystkie mają ten sam identyfikator 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());

Powroty

String – identyfikator iUID wydarzenia;

Upoważnienie

Skrypty korzystające z tej metody wymagają autoryzacji za pomocą powiązanego interfejsu API REST z co najmniej jednym z tych zakresów lub odpowiednich zakresów:

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

getLastUpdated()

Pobiera datę ostatniej aktualizacji zdarzenia.

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

Powroty

Date – data ostatniej aktualizacji,

Upoważnienie

Skrypty korzystające z tej metody wymagają autoryzacji za pomocą powiązanego interfejsu API REST z co najmniej jednym z tych zakresów lub odpowiednich zakresów:

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

getLocation()

Określa lokalizację wydarzenia.

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

Powroty

String – lokalizacja wydarzenia,

Upoważnienie

Skrypty korzystające z tej metody wymagają autoryzacji za pomocą powiązanego interfejsu API REST z co najmniej jednym z tych zakresów lub odpowiednich zakresów:

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

getMyStatus()

Pobiera stan wydarzenia (np. bierze udział w wydarzeniu lub zaproszono) użytkownika. Zawsze zwraca wartość GuestStatus.OWNER, jeśli właścicielem zdarzenia jest rzeczywisty użytkownik.

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

Powroty

GuestStatus – stan,

Upoważnienie

Skrypty korzystające z tej metody wymagają autoryzacji za pomocą powiązanego interfejsu API REST z co najmniej jednym z tych zakresów lub odpowiednich zakresów:

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

getOriginalCalendarId()

Uzyskaj identyfikator kalendarza, w którym utworzono to wydarzenie.

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

Powroty

String – identyfikator oryginalnego kalendarza;

Upoważnienie

Skrypty korzystające z tej metody wymagają autoryzacji za pomocą powiązanego interfejsu API REST z co najmniej jednym z tych zakresów lub odpowiednich zakresów:

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

getPopupReminders()

Pobiera wartości minut dla wszystkich wyskakujących przypomnień o wydarzeniu.

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

Powroty

Integer[] – tablica, w której każda wartość odpowiada liczbie minut poprzedzającej zdarzenie, które zostało aktywowane.

Upoważnienie

Skrypty korzystające z tej metody wymagają autoryzacji za pomocą powiązanego interfejsu API REST z co najmniej jednym z tych zakresów lub odpowiednich zakresów:

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

getSmsReminders()

Pobiera minuty dla wszystkich przypomnień SMS o wydarzeniu.

Powroty

Integer[] – tablica, w której każda wartość odpowiada liczbie minut poprzedzającej zdarzenie, które zostało aktywowane.

Upoważnienie

Skrypty korzystające z tej metody wymagają autoryzacji za pomocą powiązanego interfejsu API REST z co najmniej jednym z tych zakresów lub odpowiednich zakresów:

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

getTag(key)

Pobiera wartość tagu zdarzenia.

Parametry

NazwaTypOpis
keyStringklucz

Powroty

String – wartość tagu,

Upoważnienie

Skrypty korzystające z tej metody wymagają autoryzacji za pomocą powiązanego interfejsu API REST z co najmniej jednym z tych zakresów lub odpowiednich zakresów:

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

getTitle()

Pobiera nazwę wydarzenia.

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

Powroty

String – tytuł,

Upoważnienie

Skrypty korzystające z tej metody wymagają autoryzacji za pomocą powiązanego interfejsu API REST z co najmniej jednym z tych zakresów lub odpowiednich zakresów:

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

getVisibility()

pobiera widoczność wydarzenia.

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

Powroty

Visibility – wartość widoczności,

Upoważnienie

Skrypty korzystające z tej metody wymagają autoryzacji za pomocą powiązanego interfejsu API REST z co najmniej jednym z tych zakresów lub odpowiednich zakresów:

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

guestsCanInviteOthers()

Określa, czy goście mogą zapraszać innych gości.

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

Powroty

Booleantrue, jeśli goście mogą zapraszać inne osoby; false, jeśli nie

Upoważnienie

Skrypty korzystające z tej metody wymagają autoryzacji za pomocą powiązanego interfejsu API REST z co najmniej jednym z tych zakresów lub odpowiednich zakresów:

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

guestsCanModify()

Określa, czy goście mogą modyfikować wydarzenie.

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

Powroty

Booleantrue, jeśli goście mogą modyfikować wydarzenie; jeśli nie: false

Upoważnienie

Skrypty korzystające z tej metody wymagają autoryzacji za pomocą powiązanego interfejsu API REST z co najmniej jednym z tych zakresów lub odpowiednich zakresów:

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

guestsCanSeeGuests()

Określa, czy goście mogą widzieć innych gości.

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

Powroty

Booleantrue, jeśli goście mogą wyświetlać innych gości; jeśli nie: false

Upoważnienie

Skrypty korzystające z tej metody wymagają autoryzacji za pomocą powiązanego interfejsu API REST z co najmniej jednym z tych zakresów lub odpowiednich zakresów:

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

isOwnedByMe()

Określa, czy jesteś właścicielem wydarzenia.

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

Powroty

Booleantrue, jeśli zdarzenie należy do rzeczywistego użytkownika; w przeciwnym razie false

Upoważnienie

Skrypty korzystające z tej metody wymagają autoryzacji za pomocą powiązanego interfejsu API REST z co najmniej jednym z tych zakresów lub odpowiednich zakresów:

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

removeAllReminders()

Usuwa wszystkie przypomnienia z wydarzenia.

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

Powroty

CalendarEventSeries – ten CalendarEventSeries do łańcuchów

Upoważnienie

Skrypty korzystające z tej metody wymagają autoryzacji za pomocą powiązanego interfejsu API REST z co najmniej jednym z tych zakresów lub odpowiednich zakresów:

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

removeGuest(email)

usuwa gościa z wydarzenia.

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

Parametry

NazwaTypOpis
emailStringadres e-mail gościa

Powroty

CalendarEventSeries – ten CalendarEventSeries do łańcuchów

Upoważnienie

Skrypty korzystające z tej metody wymagają autoryzacji za pomocą powiązanego interfejsu API REST z co najmniej jednym z tych zakresów lub odpowiednich zakresów:

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

resetRemindersToDefault()

Resetuje przypomnienia przy użyciu domyślnych ustawień kalendarza.

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

Powroty

CalendarEventSeries – ten CalendarEventSeries do łańcuchów

Upoważnienie

Skrypty korzystające z tej metody wymagają autoryzacji za pomocą powiązanego interfejsu API REST z co najmniej jednym z tych zakresów lub odpowiednich zakresów:

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

setAnyoneCanAddSelf(anyoneCanAddSelf)

Określa, czy goście, którzy nie są gośćmi, mogą dodawać się do wydarzenia.

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

Parametry

NazwaTypOpis
anyoneCanAddSelfBooleanczy każdy może zaprosić siebie

Powroty

CalendarEventSeries – ten CalendarEventSeries do łańcuchów

Upoważnienie

Skrypty korzystające z tej metody wymagają autoryzacji za pomocą powiązanego interfejsu API REST z co najmniej jednym z tych zakresów lub odpowiednich zakresów:

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

setColor(color)

Ustawia kolor wydarzenia w kalendarzu.

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

Parametry

NazwaTypOpis
colorStringIndeks koloru liczby całkowitej w postaci ciągu znaków lub wartości z CalendarApp.EventColor.

Powroty

CalendarEventSeries – to wydarzenie z kalendarza na potrzeby łańcuchów.

Upoważnienie

Skrypty korzystające z tej metody wymagają autoryzacji za pomocą powiązanego interfejsu API REST z co najmniej jednym z tych zakresów lub odpowiednich zakresów:

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

setDescription(description)

Ustawia opis zdarzenia.

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

Parametry

NazwaTypOpis
descriptionStringnowy opis

Powroty

CalendarEventSeries – ten CalendarEventSeries do łańcuchów

Upoważnienie

Skrypty korzystające z tej metody wymagają autoryzacji za pomocą powiązanego interfejsu API REST z co najmniej jednym z tych zakresów lub odpowiednich zakresów:

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

setGuestsCanInviteOthers(guestsCanInviteOthers)

Określa, czy goście mogą zapraszać innych gości.

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

Parametry

NazwaTypOpis
guestsCanInviteOthersBooleanczy goście mogą zapraszać inne osoby

Powroty

CalendarEventSeries – ten CalendarEventSeries do łańcuchów

Upoważnienie

Skrypty korzystające z tej metody wymagają autoryzacji za pomocą powiązanego interfejsu API REST z co najmniej jednym z tych zakresów lub odpowiednich zakresów:

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

setGuestsCanModify(guestsCanModify)

Określa, czy goście mogą modyfikować wydarzenie.

Parametry

NazwaTypOpis
guestsCanModifyBooleanczy goście mogą modyfikować wydarzenie,

Powroty

CalendarEventSeries – ten CalendarEventSeries do łańcuchów

Upoważnienie

Skrypty korzystające z tej metody wymagają autoryzacji za pomocą powiązanego interfejsu API REST z co najmniej jednym z tych zakresów lub odpowiednich zakresów:

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

setGuestsCanSeeGuests(guestsCanSeeGuests)

Określa, czy goście mogą widzieć innych gości.

Parametry

NazwaTypOpis
guestsCanSeeGuestsBooleanczy goście mogą wyświetlać

Powroty

CalendarEventSeries – ten CalendarEventSeries do łańcuchów

Upoważnienie

Skrypty korzystające z tej metody wymagają autoryzacji za pomocą powiązanego interfejsu API REST z co najmniej jednym z tych zakresów lub odpowiednich zakresów:

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

setLocation(location)

Służy do określania lokalizacji wydarzenia.

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

Parametry

NazwaTypOpis
locationStringnowa lokalizacja

Powroty

CalendarEventSeries – ten CalendarEventSeries do łańcuchów

Upoważnienie

Skrypty korzystające z tej metody wymagają autoryzacji za pomocą powiązanego interfejsu API REST z co najmniej jednym z tych zakresów lub odpowiednich zakresów:

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

setMyStatus(status)

Ustawia stan wydarzenia (np. bierze udział w wydarzeniu lub zaproszono) użytkownika.

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

Parametry

NazwaTypOpis
statusGuestStatusnowy stan

Powroty

CalendarEventSeries – ten CalendarEventSeries do łańcuchów

Upoważnienie

Skrypty korzystające z tej metody wymagają autoryzacji za pomocą powiązanego interfejsu API REST z co najmniej jednym z tych zakresów lub odpowiednich zakresów:

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

setRecurrence(recurrence, startDate)

Ustawia reguły powtarzania dla serii zdarzeń całodniowych. Zastosowanie tej metody zmienia zwykłą serię zdarzeń w serię całodniowych zdarzeń.

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

Parametry

NazwaTypOpis
recurrenceEventRecurrencereguły powtarzania, które mają być użyte,
startDateDatedata pierwszego zdarzenia w serii (stosowany jest tylko dzień; godzina jest ignorowana)

Powroty

CalendarEventSeries – ta seria wydarzeń Kalendarza do tworzenia łańcuchów

Upoważnienie

Skrypty korzystające z tej metody wymagają autoryzacji za pomocą powiązanego interfejsu API REST z co najmniej jednym z tych zakresów lub odpowiednich zakresów:

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

setRecurrence(recurrence, startTime, endTime)

Ustawia reguły powtarzania dla tej serii zdarzeń. Zastosowanie tej metody zmienia serię zdarzeń z całego dnia w zwykłą serię zdarzeń.

// Sets the events in a series to take place from 3pm to 4pm every Tuesday and Thursday in
// 2013.
var eventSeries = CalendarApp.getDefaultCalendar().getEventSeriesById('123456789@google.com');
var startTime = new Date('January 1, 2013 03:00:00 PM EST');
var endTime = new Date('January 1, 2013 04:00:00 PM EST');
var recurrence = CalendarApp.newRecurrence().addWeeklyRule()
     .onlyOnWeekdays([CalendarApp.Weekday.TUESDAY, CalendarApp.Weekday.THURSDAY])
     .until(new Date('January 1, 2014'));
eventSeries.setRecurrence(recurrence, startTime, endTime);

Parametry

NazwaTypOpis
recurrenceEventRecurrencereguły powtarzania, które mają być użyte,
startTimeDatedata i godzina rozpoczęcia pierwszego wydarzenia w serii
endTimeDatedata i godzina zakończenia pierwszego wydarzenia w serii

Powroty

CalendarEventSeries – ta seria wydarzeń Kalendarza do tworzenia łańcuchów

Upoważnienie

Skrypty korzystające z tej metody wymagają autoryzacji za pomocą powiązanego interfejsu API REST z co najmniej jednym z tych zakresów lub odpowiednich zakresów:

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

setTag(key, value)

Ustawia w zdarzeniu tag klucz/wartość służący do przechowywania niestandardowych metadanych.

Parametry

NazwaTypOpis
keyStringklucz tagu
valueStringwartość tagu

Powroty

CalendarEventSeries – ten CalendarEventSeries do łańcuchów

Upoważnienie

Skrypty korzystające z tej metody wymagają autoryzacji za pomocą powiązanego interfejsu API REST z co najmniej jednym z tych zakresów lub odpowiednich zakresów:

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

setTitle(title)

Ustawia tytuł wydarzenia.

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

Parametry

NazwaTypOpis
titleStringnowy tytuł

Powroty

CalendarEventSeries – ten CalendarEventSeries do łańcuchów

Upoważnienie

Skrypty korzystające z tej metody wymagają autoryzacji za pomocą powiązanego interfejsu API REST z co najmniej jednym z tych zakresów lub odpowiednich zakresów:

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

setVisibility(visibility)

Ustawia widoczność wydarzenia.

Parametry

NazwaTypOpis
visibilityVisibility

Powroty

CalendarEventSeries – ten CalendarEventSeries do łańcuchów

Upoważnienie

Skrypty korzystające z tej metody wymagają autoryzacji za pomocą powiązanego interfejsu API REST z co najmniej jednym z tych zakresów lub odpowiednich zakresów:

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