Created
January 24, 2020 13:32
-
-
Save larsbergstrom/04095ab064f7f171da429899fb8431df to your computer and use it in GitHub Desktop.
Delete a week in gcal
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 cleanup() | |
{ | |
var fromDate = new Date(2017,11,12,0,0,0); | |
var toDate = new Date(2017,11,16,0,0,0); | |
var calendarName = 'Mozilla'; | |
var calendar = CalendarApp.getCalendarsByName(calendarName)[0]; | |
var events = calendar.getEvents(fromDate, toDate); | |
for(var i=0; i<events.length;i++){ | |
var ev = events[i]; | |
if (ev.getGuestList().length == 0) { | |
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