批量删除Google日历活动

时间:2014-04-14 07:16:38

标签: javascript google-apps-script

我想删除在活动名称“Stockholm”中具有特殊字词的日历活动。

我得到了这个,但它只是按日期。可以通过关键字来完成吗?

var fromDate = new Date(2013,0,1,0,0,0);
var toDate = new Date(2013,0,4,0,0,0);
var calendarName = 'My Calendar';

// delete from Jan 1 to end of Jan 4, 2013

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(ev.getTitle()); // show event name in log
  ev.deleteEvent();
}

0 个答案:

没有答案