我不知道JavaScript(我知道一點Java),但我想寫一個簡單的腳本來刪除我的學校課程活動,當有度假活動,但它根本不起作用......問題是什麼?Google Apps腳本(日曆) - 比較兩個事件是否在同一天
function vacations()
{
var school_calendar = CalendarApp.getCalendarsByName("Timetable")[0].getEvents(new Date("September 1, 2016"),new Date("June 20, 2017"));
var vacations = CalendarApp.getCalendarsByName("Vacations")[0].getEvents(new Date("September 1, 2016"),new Date("June 20, 2017"));
for (var i = 0; i < vacations.length; i++)
{
var vacation = vacations[i];
for (var j = 0; j < school_calendar.length; j++)
{
var school_class = school_calendar[j];
if(vacation.getAllDayStartDate() == school_class.getStartTime())
{
school_class.deleteEvent();
}
}
}
}