Created
August 28, 2017 18:26
-
-
Save beefy/55ef6bc0e0d76b4bbae365e3ae4b18c2 to your computer and use it in GitHub Desktop.
Delete all google calendar events in a range
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function myFunction() { | |
var fromDate = new Date(2017,8,1,0,0,0); | |
var toDate = new Date(2017,8,16,0,0,0); | |
// delete from Sept 1 through Sept 15, 2017 | |
var calendar = CalendarApp.getCalendarsByName('NateSchultz')[0]; | |
var events = calendar.getEvents(fromDate, toDate); | |
for(var i=0; i<events.length;i++){ | |
var ev = events[i]; | |
Logger.log(ev.getTitle()); // show event name in log | |
ev.deleteEvent(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Run online at
https://script.google.com/macros/
Rename calendar name to match.