Google Apps脚本日历服务:获取重复(全天)活动的开始日期

时间:2020-02-15 17:50:52

标签: google-apps-script calendar

我指的是this question。在标准模式下(不启用“高级Google服务”),仍无法检索重复(全天)事件的开始日期吗?

1 个答案:

答案 0 :(得分:1)

这样做吗?

function findFirstEvent() {
  var cal=CalendarApp.getCalendarById("Calendar Id");
  var startTime=new Date(1850,0,1);
  var endTime=new Date();
  var events=cal.getEvents(startTime, endTime,{search:'Keywords contained in the event or just the title'});
  Logger.log('StartTime: %s, Id: %s',events[0].getStartTime(),events[0].getId());
}