Apps脚本.getStartTime()不起作用 [英] Apps Scripts .getStartTime() doesn't work
问题描述
所以我有一个从Google日历获取信息的脚本.
so i have a script that gets information from google calendar.
var cal = CalendarApp.getCalendarById(calendarId);
var events = cal.getEventSeriesById(eventId);
var details = [[events.getTitle(), events.getDescription(), events.getStartTime(), events.getEndTime()]];
但是每当我尝试运行它时,都会出现错误
TypeError: Cannot find function getStartTime in object CalendarEventSeries.
为什么不起作用?.getStartTime是Google自己的网站上列出的函数
https://developers.google.com/apps-script /reference/calendar/calendar-event#getStartTime()
but whenever i try to run it, i get the error TypeError: Cannot find function getStartTime in object CalendarEventSeries.
why doesn't it work?, .getStartTime is a function listed on google's own website
https://developers.google.com/apps-script/reference/calendar/calendar-event#getStartTime()
推荐答案
getStartTime是在CalendarEvent类而不是CalendarEventSeries上定义的.这就是为什么您得到错误. 请检查文档-
getStartTime is defined on the CalendarEvent class and not CalendarEventSeries. That's why you are getting the error. Please check the documentation -
CalendarEvent: https://developers.google.com/apps -script/reference/calendar/calendar-event CalendarEventSeries: https://developers.google.com/apps-脚本/参考/日历/日历事件系列
CalendarEvent : https://developers.google.com/apps-script/reference/calendar/calendar-event CalendarEventSeries : https://developers.google.com/apps-script/reference/calendar/calendar-event-series
这篇关于Apps脚本.getStartTime()不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!