From 62663799c54d2c4a55d745b20e1879f6c74e8530 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20Lei=C3=9F?= Date: Sun, 17 Apr 2022 09:31:37 +0200 Subject: [PATCH] Support reoccurring events. --- README.md | 6 ++++++ index.ts | 2 ++ package-lock.json | 4 ++-- package.json | 2 +- 4 files changed, 11 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 067a5a6..008caf8 100644 --- a/README.md +++ b/README.md @@ -29,6 +29,12 @@ Details of the event will be left out - it will only be visible as 'Private even ``` - Run it with `npx -y @cirqusde/google-calendar-sync` (or even better: Add a cronjob to run it repeatedly) +## Known caveats +- Google calendar does not manage event reminders per event but instead manages them per event & user: + Multiple users that attend the same event can have different reminders, and a user can only manage its own reminders. + As the events are created by a service account, the service account can only change its own reminders, not yours. + All events created by the service account will have the default reminders for your calendar set. This might be fine for you with the default settings (10 mins before the event), but you also might want to remove the default reminder within your (work) calendar settings. + ## Publish to npm - Bump version in `package.json` - Run `npm install` diff --git a/index.ts b/index.ts index b587aa0..094fbe3 100755 --- a/index.ts +++ b/index.ts @@ -37,6 +37,7 @@ const syncCalendar = async (): Promise<{ calendarId: configEntry.sourceCalendar, timeMin: earliestDate.toISOString(), timeMax: latestDate.toISOString(), + singleEvents: true, }); let sourceEvents: calendar_v3.Schema$Event[] = sourceEventsResponse.data.items || []; @@ -48,6 +49,7 @@ const syncCalendar = async (): Promise<{ calendarId: configEntry.targetCalendar, timeMin: earliestDate.toISOString(), timeMax: latestDate.toISOString(), + singleEvents: true, }); const targetEvents = targetEventsResponse.data.items; diff --git a/package-lock.json b/package-lock.json index 1973a6a..b4e318c 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@cirqusde/google-calendar-sync", - "version": "1.0.1", + "version": "1.0.2", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "@cirqusde/google-calendar-sync", - "version": "1.0.1", + "version": "1.0.2", "license": "MIT", "dependencies": { "googleapis": "^100.0.0", diff --git a/package.json b/package.json index 45836c4..223b52b 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@cirqusde/google-calendar-sync", - "version": "1.0.1", + "version": "1.0.2", "repository": "https://github.com/cirqusde/google-calendar-sync", "description": "Sync events from your private Google Calendar to your work Google calendar.", "author": "Simon Leiß",