This project allows you to sync events in two calendars (e.g. Work Calendar
and Personal Calendar
).
- Share and subscribe your calendars with each other; (You can follow instructions in Google Help for Share and Subscribe).
- Create a new project in Google Apps Script;
- Create two files with content in
main.gs
andconfig.gs
; - In
config.gs
file add the Calendar Id you want to keep synced. (e.g. your-email@gmail.com)
You can create Habits (e.g. Lunch Time
, Focus Time
) that will sync, but the script will keep the original title of the event.
To define your habits, just open the config.gs
file and update the habits array.
const habits = ["🍝 Lunch Time", "🧐 Focus Time"];
With the habits setup done, just create events in your calendar with the same title you defined in the habits array.
To keep the calendars in sync you need to create a trigger that will run the script.
In the triggers tab in your Google Apps Script project, add a new trigger to run StartSync
.
You can select the options you prefer, but it is recommended that you use the options as follows:
Select event source:
Time-driven
Select type of time based trigger:Minutes timer
Select minute interval:Every 10 minutes
Or greater
This script is created based on this gist file.