Meeting Notes for Mattr, and a few others.
This commit is contained in:
@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user