下面的代码事件是假设从谷歌日历GoogleAppsScript - 无法从日历
// The code below will retrieve all the events for the user's default calendar and
// display the description of the first event
var cal = CalendarApp.getDefaultCalendar();
Logger.log(cal.getName());
var events = cal.getEvents(new Date("July 01, 2012 EST"), new Date("July 30, 2012 EST"));
if (events[0]) {
Logger.log(events[0].getDescription());
}
else
{
Logger.log("No events found");
}
但其只打印“未找到任何活动”获得七月一个月的事件,
我核实日历命名它获得正确的日历,虽然没有得到事件
还有什么需要验证?
“Logger.log(cal.getName())”,在上面的代码,是给正确的用户名 – Arun 2012-07-28 19:32:42
也许请检查你看实际上是在用户的事件日历,而不是在他们创建的另一个日历中。我可以复制'找不到事件'的唯一方法是在默认日历中没有事件。你的代码看起来不错。 – Weehooey 2012-07-28 19:51:23
我验证了事件存在于适当的日历中,但没有运气,是否还有其他东西丢失。我正通过Chrome浏览器的https://script.google.com从容器执行脚本 – Arun 2012-07-29 18:32:00