Skip to content

Instantly share code, notes, and snippets.

@AndrewSouthpaw
AndrewSouthpaw / calendarCopy.js
Last active January 22, 2026 19:41
Google Apps script to copy personal events and block those times in your work calendar.
// *******************
// 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.
//
@alranel
alranel / block_personal_appts.js
Last active January 22, 2026 01:15 — forked from ttrahan/block_personal_appts
Google Apps Script to automatically create, edit and delete events on work calendar for personal calendar events. Inspired by @willroman's work but heavily changed. Instructions on how to set up can be found in the original post: https://medium.com/@willroman/auto-block-time-on-your-work-google-calendar-for-your-personal-events-2a752ae91dab
var source_calendars = [
'xxx',
];
function sync() {
var today = new Date();
var enddate = new Date();
enddate.setDate(today.getDate()+90); // how many days in advance to monitor and block off time
var sourceEvents = [];