0

so i have a script that gets information from google calendar.

var cal = CalendarApp.getCalendarById(calendarId);
var events = cal.getEventSeriesById(eventId);
var details = [[events.getTitle(), events.getDescription(), events.getStartTime(), events.getEndTime()]];

but whenever i try to run it, i get the error
TypeError: Cannot find function getStartTime in object CalendarEventSeries.
why doesn't it work?, .getStartTime is a function listed on google's own website
https://developers.google.com/apps-script/reference/calendar/calendar-event#getStartTime()

Rubén
  • 34,714
  • 9
  • 70
  • 166
TTDA
  • 69
  • 9

1 Answers1

2

getStartTime is defined on the CalendarEvent class and not CalendarEventSeries. That's why you are getting the error. Please check the documentation -

CalendarEvent : https://developers.google.com/apps-script/reference/calendar/calendar-event CalendarEventSeries : https://developers.google.com/apps-script/reference/calendar/calendar-event-series

Tushar
  • 3,022
  • 2
  • 26
  • 26
  • omg, google and its different classes, makes things so confusing, getting the start time of a event when i know the event id shouldn't be impossible..... – TTDA Oct 26 '16 at 12:46
  • 2
    This might help : http://stackoverflow.com/questions/30652240/google-apps-script-event-settime-error-and-time-format#answer-30657751 – Tushar Oct 26 '16 at 13:10