Skip to content

Instantly share code, notes, and snippets.

View alranel's full-sized avatar
👨‍💻

Alessandro Ranellucci alranel

👨‍💻
View GitHub Profile
@alranel
alranel / block_personal_appts.js
Last active January 23, 2023 15:10 — 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 = [];