Skip to content

Instantly share code, notes, and snippets.

Will wroman

  • Austin, TX
Block or report user

Report or block wroman

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
@wroman
wroman / calendarblock
Last active Sep 4, 2018
Auto Block Time on Primary Google Calendar from Events on Secondary Calendar - Instructions: https://medium.com/@willroman/auto-block-time-on-your-work-google-calendar-for-your-personal-events-2a752ae91dab
View calendarblock
function sync() {
var id="XXXXXXXX"; // CHANGE - id of the secondary calendar to pull events from
var secondaryCal=CalendarApp.getCalendarById(id);
var today=new Date();
var enddate=new Date();
enddate.setDate(today.getDate()+30); // how many days in advance to monitor and block off time
var secondaryEvents=secondaryCal.getEvents(today,enddate);
You can’t perform that action at this time.