Skip to content

Commit

Permalink
Custom event filters (#443)
Browse files Browse the repository at this point in the history
  • Loading branch information
jonas0b1011001 authored May 28, 2024
1 parent 2c88b06 commit dd4c000
Show file tree
Hide file tree
Showing 3 changed files with 357 additions and 152 deletions.
8 changes: 1 addition & 7 deletions Code.gs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ var sourceCalendars = [ // The ics/ical urls that you want to get
];

var howFrequent = 15; // What interval (minutes) to run this script on to check for new events. Any integer can be used, but will be rounded up to 5, 10, 15, 30 or to the nearest hour after that.. 60, 120, etc. 1440 (24 hours) is the maximum value. Anything above that will be replaced with 1440.
var onlyFutureEvents = false; // If you turn this to "true", past events will not be synced (this will also removed past events from the target calendar if removeEventsFromCalendar is true)
var addEventsToCalendar = true; // If you turn this to "false", you can check the log (View > Logs) to make sure your events are being read correctly before turning this on
var modifyExistingEvents = true; // If you turn this to "false", any event in the feed that was modified after being added to the calendar will not update
var removeEventsFromCalendar = true; // If you turn this to "true", any event created by the script that is not found in the feed will be removed.
Expand Down Expand Up @@ -130,8 +129,6 @@ function uninstall(){
deleteAllTriggers();
}

var startUpdateTime;

// Per-calendar global variables (must be reset before processing each new calendar!)
var calendarEvents = [];
var calendarEventsIds = [];
Expand All @@ -157,9 +154,6 @@ function startSync(){

PropertiesService.getUserProperties().setProperty('LastRun', new Date().getTime());

if (onlyFutureEvents)
startUpdateTime = new ICAL.Time.fromJSDate(new Date(), true);

//Disable email notification if no mail adress is provided
emailSummary = emailSummary && email != "";

Expand Down Expand Up @@ -259,4 +253,4 @@ function startSync(){
// (the message text does not seem to be logged anywhere)
throw new Error('The sync operation produced errors. See log for details.');
}
}
}
Loading

0 comments on commit dd4c000

Please sign in to comment.