0
votes

I can't figure out why I get this error. The sheet is found here: https://docs.google.com/spreadsheets/d/1gBXtHjEhnNSEkJYq2upCWtwkj1ZLWiUYv6KSuMH8Nds/edit?usp=sharing

Here's the first part of the script where it seems to hang up. The last line is line 13 referenced in the error message.

function pushToCalendar() {
    //spreadsheet variables   
    var sheet = SpreadsheetApp.getActiveSheet();
    var headerRows = 1;
    var range = sheet.getDataRange();
    var data = range.getValues();
    for (var i in data) {
        if (i < headerRows) continue;
        var row = data[i]
        var tstart = new Date(row[8]);
        tstart.setDate(date.getDate());
    }
}
2

2 Answers

1
votes

Because getDate() only works with date object, and 'date' is not defined as a Date object in your present code. Use any Date object, or you can do in this way, tstart.setDate((new Date()).getDate());

-2
votes

I went a different route and was able to accomplish what I wanted.