Skip to content

Instantly share code, notes, and snippets.

Yak shaving

Carlos Sanchez carlossg

Yak shaving
View GitHub Profile
carlossg / block_personal_appts
Last active Sep 12, 2018 — forked from ttrahan/block_personal_appts
Google Apps Script to automatically create, edit and delete events on work calendar for personal calendar events. Instructions on how to set up can be found at
View block_personal_appts
function sync() {
var id="XXXXXXXXX"; // CHANGE - id of the secondary calendar to pull events from
var today=new Date();
var enddate=new Date();
enddate.setDate(today.getDate()+7); // how many days in advance to monitor and block off time
var secondaryCal=CalendarApp.getCalendarById(id);
// var secondaryEvents=secondaryCal.getEvents(today,enddate,{statusFilters: [CalendarApp.GuestStatus.YES]});
You can’t perform that action at this time.