title: Google Script - Cannot find method getEventsforDay(string) error
body: <p>I am trying to create a Google Script that allows me to pull events from multiple sheets into a Google Calendar, but am running into trouble with duplicates. I am thinking that I have to delete the events before creating new ones (in order to update), but am running into an issue with a "Cannot find method getEventsForDay(string)" error. Any suggestions?</p>
  
  <pre><code>function pushToPreKCalendar(){
    var ss = SpreadsheetApp.getActiveSpreadsheet();
    var sheet = ss.getSheetByName("Pre-K");
    var lastRow = sheet.getLastRow(); 
    var range = sheet.getRange(3,1,lastRow,100);
    var values = range.getValues();   
    var data = range.getValues();
    var cal1 = CalendarApp.getCalendarsByName("WDW FB")[0];
    var cal2 = CalendarApp.getCalendarsByName("WDW Latino FB")[0];
    var cal3 = CalendarApp.getCalendarsByName("WDW Pinterest")[0];
    for (i in data){ 
    var row = data[i];
    var title = row[0];
    var date = row[2];
    var desc = row[3];
    var cal = row[4];
    var events1 = cal1.getEventsForDay(date);
       for (var i=0; i&lt;events1.length;i++){
       var ev1 = events1[i];
       Logger.log(ev1.getTitle());
       ev1.deleteEvent();
    }
    var events2 = cal2.getEventsForDay(date);
    for (var i=0; i&lt;events2.length;i++){
      var ev2 = events2[i];
      Logger.log(ev2.getTitle());
      ev2.deleteEvent();
    }
    var events3 = cal3.getEventsForDay(date);
    for (var i=0; i&lt;events3.length;i++){
      var ev3 = events3[i];
      Logger.log(ev3.getTitle());
      ev3.deleteEvent();
    }
          if (cal=="WDW FB")
            var newEvent = cal1.createAllDayEvent(title, date, {description:desc});
          if (cal=="WDW Latino FB")
            var newEvent = cal2.createAllDayEvent(title, date, {description:desc});
          if (cal== "WDW Pinterest")
            var newEvent = cal3.createAllDayEvent(title, date, {description:desc});
    }
  }
  </code></pre>