Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save torokmark/b06783c5f8ff5847cd10dda6156fac4f to your computer and use it in GitHub Desktop.
Save torokmark/b06783c5f8ff5847cd10dda6156fac4f to your computer and use it in GitHub Desktop.
remove recurring all day events from google calendar
function main() {
getEventSeries();
}
function getEventSeries() {
var calendar = CalendarApp.getCalendarById("email-address");
for (var month = 0; month < 13; month += 1) {
var date = new Date(2012, month, 1);
var eventsOnDay = calendar.getEvents(new Date(2012, date.getMonth() , 1), new Date(2012, date.getMonth() + 1, 0));
for (var ej = 0; ej < eventsOnDay.length; ej += 1) {
if (eventsOnDay[ej].isAllDayEvent() && eventsOnDay[ej].isRecurringEvent()) {
Logger.log(eventsOnDay[ej].getEventSeries().getTitle());
Utilities.sleep(500);
eventsOnDay[ej].getEventSeries().deleteEventSeries();
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment