Google Script to change privacy of events in Calendar
For unkown reason (probably me), several events in my Calendar went "public"...
This is how I made them private (my "default" is "private" ):
- Go to https://script.google.com/home
- Create new Project
- Use this code (has many drawbacks)
function main() {
var now = new Date();
var oneYearBefore= new Date(now.getTime() - (365 * 24 * 60 * 60 * 1000));
var events = CalendarApp.getDefaultCalendar().getEvents(oneYearBefore, now);
events.forEach(function(e) {
e.setVisibility(CalendarApp.Visibility.DEFAULT);
});
}