Лістинг коду файлу calendar.gs function createEventsFromSpreadsheet() {
let calendar =
CalendarApp.getCalendarById("a35f1488c891e78acd2b83a680bf91f3bec2887e8e1bc413d9b8ec7
b0f8aa44a@group.calendar.google.com");
let sheet = SpreadsheetApp.getActiveSpreadsheet().getSheetByName('tasks');
let schedule = sheet.getDataRange().getValues();
schedule.splice(0, 1);
schedule.forEach(function(entry) {
var id = entry[7];
Logger.log(id);
if (id == "") {
createNewEvent(entry, calendar, sheet);
} else {
updateExistingEvent(entry, id, calendar);
}
});
}
function createNewEvent(entry, calendar, sheet) {
let event = calendar.createAllDayEvent(entry[4], new Date(entry[1]), new
Date(entry[2]));
event.addGuest(entry[3]);
var newId = event.getId();
sheet.getRange(schedule.indexOf(entry)+2, 8).setValue(newId);
Logger.log(newId);
sendEmailNotification(entry[3], entry[4], entry[1], entry[2]);
}
function updateExistingEvent(entry, id, calendar) {
let event = CalendarApp.getEventById(id);
Logger.log(event);