我正在尝试为与会者列出日历上的活动。我注意到没有列出重复活动的与会者,只有创作者。当我通过网站查看日历时,会列出与会者。我通过单一事件来查询。我是否必须以不同方式处理这些事件以吸引与会者?
function listEvents() {
var ss = SpreadsheetApp.getActiveSpreadsheet();
var sheet = ss.getActiveSheet();
var data = sheet.getDataRange();
sheet.clearContents();
var calendarId = 'primary';
var now = new Date();
var events = Calendar.Events.list(calendarId, {
timeMin: now.toISOString(),
singleEvents: true,
orderBy: 'startTime',
maxResults: 5
});
if (events.items && events.items.length > 0) {
for (var i = 0; i < events.items.length; i++) {
var event = events.items[i];
if (event.start.date) {
// All-day event.
var start = parseDate(event.start.date);
} else {
var start = parseDate(event.start.dateTime);
var end = parseDate(event.end.dateTime);
var duration = (end-start);
var creator = event.creator.email;
sheet.appendRow([creator,event.summary, start.toLocaleString(), end.toLocaleString(), duration]);
if (event.attendees) {
for (var j = 0; j < event.attendees.length; j++) {
sheet.appendRow([event.attendees[j].email,event.summary, start.toLocaleString(), end.toLocaleString(), duration]);
}
}
}
}
} else {
Logger.log('No events found.');
}
}
答案 0 :(得分:0)
您可以使用以下代码段来验证与会者&#39;按ID:
event = Calendar.Events.insert(event, calendarId);
Logger.log('Event ID: ' + event.getId());
以下是创建重复活动的官方Google文档:https://developers.google.com/google-apps/calendar/recurringevents