Skip to content

Instantly share code, notes, and snippets.

KaiKloepfer

Block or report user

Report or block KaiKloepfer

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@KaiKloepfer
KaiKloepfer / block_personal_appts
Last active Apr 14, 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 https://medium.com/@willroman/auto-block-time-on-your-work-google-calendar-for-your-personal-events-2a752ae91dab
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
today.setDate(today.getDate()-7); //how many days in the past to retroactivly update changes
var secondaryCal=CalendarApp.getCalendarById(id);
You can’t perform that action at this time.