Skip to content

Instantly share code, notes, and snippets.

@nvanexan
nvanexan / Code.gs
Created September 24, 2021 20:07
Google Apps Script for Consolidating Many Calendars into One
const now = new Date();
const thirtyDaysFromNow = new Date(now.getTime() + (30 * 24 * 60 * 60 * 1000));
const sourceCalendarIds = [] // array of ids of calendars you want to consolidate
const targetCalendarId = '' // string of your target calendar id (i.e. the calendar you want to consolidate events to)
const sourceCalendars = sourceCalendarIds.map(id => CalendarApp.getCalendarById(id))
const targetCalendar = CalendarApp.getCalendarById('')
function sync() {