在Gcalendar中创建一个振动
我如何在每个脚本中在gcalendar中创建焦点时间。我已经创建了这个scipt,但是我会回到一个错误。有人使用我的理解是正确的,语法还可以:
function myFunction() {
//Is is working
var event1 = CalendarApp.getDefaultCalendar().createEvent('MyTimeSlot', new Date('Juni 01, 2022 20:00:00 UTC'), new Date('Juni 01, 2022 21:00:00 UTC'));
// Error: ReferenceError: CalendarEvent is not defined
var event2 = CalendarApp.getDefaultCalendar(">>>MyTimeSlot with FOCUS TIME<<<", new Date('Juni 01, 2022 20:00:00 UTC'), new Date('Juni 01, 2022 21:00:00 UTC'), {type: CalendarEvent.EventType.FOCUS_TIME});
event1.setColor(CalendarApp.EventColor.PALE_BLUE);
event2.setColor(CalendarApp.EventColor.PALE_RED);
}
问候
how I can create a focus time in GCalendar per script. I have created this scipt but I get a error back. Does anyone use why I my understanding is correct the syntax is OK:
function myFunction() {
//Is is working
var event1 = CalendarApp.getDefaultCalendar().createEvent('MyTimeSlot', new Date('Juni 01, 2022 20:00:00 UTC'), new Date('Juni 01, 2022 21:00:00 UTC'));
// Error: ReferenceError: CalendarEvent is not defined
var event2 = CalendarApp.getDefaultCalendar(">>>MyTimeSlot with FOCUS TIME<<<", new Date('Juni 01, 2022 20:00:00 UTC'), new Date('Juni 01, 2022 21:00:00 UTC'), {type: CalendarEvent.EventType.FOCUS_TIME});
event1.setColor(CalendarApp.EventColor.PALE_BLUE);
event2.setColor(CalendarApp.EventColor.PALE_RED);
}
Greetings
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
event2
上的错误是因为您正在创建focus Time
事件。评论更新
为此,已经在Google的“问题跟踪器”上报告了功能请求,您可以去那里并出演问题以获取更新:
The error on
event2
is because you are creating aFocus Time
event.Update from comment
There is already a feature request reported on Google's Issue Tracker for this, you can go there and star the issue to get updates on it: