Google Calendar to Roam Integration

The Google Calendar to Roam Integration allows users to import the list of events on a given day into their daily notes page. The name of the script is google-calendar.

Usage

The script supports the following configuration attributes, to be added in the [[roam/js/google-calendar]] page:

  • Google Calendar - (Required) This is the calendar ID that the extension will use to query for events. It's usually your gmail address, such as dvargas92495@gmail.com.
  • Include Event Link - (Optional) Set to true if you would like to hyperlink the event summary with a link to the google calendar event. Note, because there are more characters to be typed it's a slower operation.
  • Skip Free - (Optional) Set to true if you would like to filter out the events from your calendar that you've set to 'Free'

Here's an example configuration page:

Be sure to make your calendar publicly accessible, since it needs to be queryable by the extension's api token:

In any page, create a Import Google Calendar button by typing in {{import google calendar}} (case-insensitive) in a block. Upon clicking the button, the extension will clear the button and fill the page in with the events you have scheduled for that day in the following format:

[Summary] ([Start Time (hh:mm am)] - [End Time (hh:mm pm)]) [ - link to Zoom/Meet]

It will be displayed in the timezone of your browser. It will use either the page's title if it's a daily note, or the current date if it's not.

Installation

Insert this as a child of any [[roam/js]] block to install the extension.

var old = document.getElementById("google-calendar");
if (old) {
  old.remove();
}

var s = document.createElement("script");
s.src = "https://roamjs.com/google-calendar.js";
s.id = "google-calendar";
s.async = false;
s.type = "text/javascript";
document.getElementsByTagName("head")[0].appendChild(s);

Demo