Skip to content

Sync events and block time between your work and personal calendars.

License

Notifications You must be signed in to change notification settings

henriquecouto/gs-calendar-sync

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Google App Script Calendar Sync

This project allows you to sync events in two calendars (e.g. Work Calendar and Personal Calendar).

How to use

  1. Share and subscribe your calendars with each other; (You can follow instructions in Google Help for Share and Subscribe).
  2. Create a new project in Google Apps Script;
  3. Create two files with content in main.gs and config.gs;
  4. In config.gs file add the Calendar Id you want to keep synced. (e.g. your-email@gmail.com)

Habits

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.

Automated sync

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

Thanks

This script is created based on this gist file.

About

Sync events and block time between your work and personal calendars.

Topics

Resources

License

Stars

Watchers

Forks