【发布时间】:2019-07-10 14:33:35
【问题描述】:
在 Google 日历中,可以创建一个“不在办公室”活动,该活动会自动拒绝未来对已设置活动的所有邀请。
我正在尝试使用 Google 脚本 API 创建此类事件,但不知何故我无法做到。
到目前为止,我一直在写这个:
function createOutOfOffice(date){
var startDate = new Date(date);
startDate.setHours(0,0,0,0);
var endDate = new Date(startDate);
endDate.setDate(startDate.getDate() + 1);
var outOfOffice = CalendarApp.createEvent('Out of office', startDate, endDate);
outOfOffice.setVisibility(CalendarApp.Visibility.PUBLIC);
outOfOffice.removeAllReminders();
}
但它不会创建真正的“外出”事件,而是会生成一个很好的旧全天事件:
我显然遗漏了一些东西,因为我创建的活动不会自动拒绝会议。
阅读api documentation,我没有发现任何明显的东西可以帮助我实现我想要的。 使用 Google App Scripts 甚至可以远程执行此操作吗?
【问题讨论】:
标签: google-apps-script google-calendar-api