diff --git a/SyncCalendarsIntoOne.gs b/SyncCalendarsIntoOne.gs index 1bb75b9..b41d838 100644 --- a/SyncCalendarsIntoOne.gs +++ b/SyncCalendarsIntoOne.gs @@ -21,6 +21,9 @@ const DEFAULT_EVENT_TITLE = "Busy" // https://unicode-table.com/en/200B/ const SEARCH_CHARACTER = "\u200B" +// Do not sync declined events. Default: false (do sync) +const DO_NOT_SYNC_DECLINED = false + // ---------------------------------------------------------------------------- // DO NOT TOUCH FROM HERE ON // ---------------------------------------------------------------------------- @@ -111,6 +114,11 @@ function createEvents(startTime, endTime) { if (event.transparency && event.transparency === "transparent") { return } + + // Don't copy declined events. + if (DO_NOT_SYNC_DECLINED && event.attendees && event.attendees.find((at) => at.self) && event.attendees.find((at) => at.self)['responseStatus'] == 'declined') { + return + } // If event.summary is undefined, empty, or null, set it to default title if (!event.summary || event.summary === "") {