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")?
Asked
Active
Viewed 289 times
0
-
1I 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 Answers
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
-
Thank you! Is this approach preferable compared with using "Advanced Google services" and `.start`? – Ben Feb 18 '20 at 18:09
-
1