1
function getEventById()
{

   var cal = CalendarApp.getDefaultCalendar();

   var eventseries = cal.getEventSeriesById("0ei62qk010k7m8faua6d0s2pbo@google.com");

   Logger.log(eventseries.getTitle());

   // how to get event from eventseries

   //Logger.log(event.getStartDate());

}

为日历文档验证了 GoogleAppsScirpt,但没有找到将 CalendarEventSeries 转换为 ClaendarEvent 对象的任何方法。

有什么办法吗?

4

2 回答 2

1

我认为,目前,没有这样的选择。可能您应该在问题跟踪器中提交功能请求。

于 2012-07-30T08:37:45.903 回答
0

这将对您有所帮助。

function delete_rec_events()
{
  //take care: Date function starts at 0 for the month (January=0)
  var fromDate = new Date(2018,0,1,0,0,0); //This is January 1, 2018
  var toDate = new Date(2018,0,10,0,0,0);   //This is January 10, 2018 at 00h00'00"
  var calendarName = '<Name of the Calendar>';

  var calendar = CalendarApp.getCalendarsByName(calendarName)[0];
  var events = calendar.getEvents(fromDate, toDate);

  for(var i=0; i<events.length;i++)
  {
    var ev = events[i];
    Logger.log('Checking Event Title === ' + calendar.getEventSeriesById(ev.getId()).getTitle());

    calendar.getEventSeriesById(ev.getId()).deleteEventSeries();
    Logger.log('Event Deleted');

  }
}
于 2018-06-09T10:12:15.333 回答