This file contains hidden or 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
// ******************* | |
// Contributors: | |
// - Andrew Smith (@AndrewSouthpaw) | |
// - Shaun Mosley (@Shaunm44) | |
// ******************* | |
// This setup will allow you to synchronize personal events from one calendar (the "secondary calendar") | |
// to another calendar, e.g. work (the "primary calendar"), but obfuscate the details. Then your coworkers | |
// know when you're busy but don't get to see the personal details. | |
// |
This file contains hidden or 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
/** | |
* Move events with a given title from your primary calendar to another calendar. | |
* You must enable the Calendar Advanced Service: | |
* https://developers.google.com/apps-script/guides/services/advanced#enabling_advanced_services | |
*/ | |
function moveEvents(eventTitle, fromCalendarName, toCalendarName) { | |
var fromCalendarId = CalendarApp.getCalendarsByName(fromCalendarName)[0].getId(); | |
var toCalendarId = CalendarApp.getCalendarsByName(toCalendarName)[0].getId(); | |
var now = new Date(); |