推送值日历 API

Push Values Calendar API

我在推送和返回包含事件标题的数组时遇到问题。就我而言,这应该将事件的标题附加到 titulos 数组中。

 for (j=0;j<events.length;j++){ 
  var titulos = []
  var events =a.getEventsForDay(testingstartdate, {search: 'OOO'});
  var eventstitle = events[j].getTitle(); 
  Logger.log(eventstitle);
  titulos.push(eventstitle);
  };

此处讨论的 Logger.log 每个标题正确返回一行,所以不确定为什么最终数组只向其推送 1 个值。

有什么想法吗?

The Logger.log in question here is returning correctly one row per title, so no sure why the final array is only pushing 1 single value to it.

发生这种情况是因为您在 for 循环的每个步骤中都定义了数组。移动以下语句:

var titulos = [];

for 循环开始之前将解决您的问题。