Skip to content

Instantly share code, notes, and snippets.

View RChutchev's full-sized avatar
💻
Remote work only 😺

Roman Chutchev RChutchev

💻
Remote work only 😺
View GitHub Profile
@AndrewSouthpaw
AndrewSouthpaw / calendarCopy.js
Created October 12, 2021 03:49
Google Apps script to copy personal events and block those times in your work calendar.
// *******************
// This setup will allow you to synchronize personal events from one calendar (the "secondary calendar")
// to another calendar, e.g. work (the "primary calendar"), but obfuscate the details. Then your coworkers
// know when you're busy but don't get to see the personal details.
//
// Follow these steps:
// 1. Go to https://script.google.com/home and click [+ New project]
// 2. Make sure the two calendars you want to sync can be edited by the Google account you're currently under
// (or switch accounts)
@erickoledadevrel
erickoledadevrel / moveToCalendar.gs
Last active November 16, 2023 07:02
Moving events from one calendar to another, using Google Apps Script
/**
* Move events with a given title from your primary calendar to another calendar.
* You must enable the Calendar Advanced Service:
* https://developers.google.com/apps-script/guides/services/advanced#enabling_advanced_services
*/
function moveEvents(eventTitle, fromCalendarName, toCalendarName) {
var fromCalendarId = CalendarApp.getCalendarsByName(fromCalendarName)[0].getId();
var toCalendarId = CalendarApp.getCalendarsByName(toCalendarName)[0].getId();
var now = new Date();