Meeting Notes for Mattr, and a few others.

This commit is contained in:
Norm Rasmussen
2023-08-31 17:45:46 -04:00
parent 255547df14
commit 59b793bb1f
4 changed files with 80 additions and 2 deletions

View File

@ -26,6 +26,7 @@ function syncCalendarAfterScrubbing() {
// Import each of those to the scrubbed calendar.
var count = 0;
var events = findEvents(SOURCE_CALENDAR_ID, today, futureDate, lastRun);
Logger.log(events);
events.forEach(function(event) {
event.organizer = {
id: SCRUBBED_CALENDAR_ID
@ -75,7 +76,15 @@ function findEvents(cal_id, start, end, opt_since) {
try {
var response = Calendar.Events.list(cal_id, params);
results = response.items.filter(function(item) {
// Filter out events where the the event is all-day
// Filter out events where the owner of the script has not accepted
if (item.attendees) {
for (person of item.attendees) {
if (person['self'] == true && person['responseStatus'] != "accepted") {
return false;
}
}
}
// Filter out events where the event is all-day
if (item.start.date) {
return false;
}