0

I'm referring to this question. Is it still not possible to retrieve the start date of a recurring (all day) event in standard mode (without enabling "Advanced Google services")?

Ben
  • 1,550
  • 1
  • 16
  • 24
  • 1
    I don't see any method in the documentation for getting the start date using the built-in CalendarApp Service : [https://developers.google.com/apps-script/reference/calendar/calendar-event-series.html](https://developers.google.com/apps-script/reference/calendar/calendar-event-series.html) – Alan Wells Feb 15 '20 at 19:34
  • Do you have the [CalendarEventSeries](https://developers.google.com/apps-script/reference/calendar/calendar-event-series.html) ID or object? Or you want the start date for all recurring events series? – Andres Duarte Feb 17 '20 at 11:37
  • Not beforehand. I want to loop through all recurring (all day) events. – Ben Feb 18 '20 at 18:10

1 Answers1

1

Does this do it:

function findFirstEvent() {
  var cal=CalendarApp.getCalendarById("Calendar Id");
  var startTime=new Date(1850,0,1);
  var endTime=new Date();
  var events=cal.getEvents(startTime, endTime,{search:'Keywords contained in the event or just the title'});
  Logger.log('StartTime: %s, Id: %s',events[0].getStartTime(),events[0].getId());
}
Cooper
  • 59,616
  • 6
  • 23
  • 54