スクリプトの目的は、Google スプレッドシートから Google カレンダーにデータをインポートすることです。
function caltest1() {
var sheet = SpreadsheetApp.getActiveSheet();
var startRow = 11; // First row of data to process
var numRows = 4; // Number of rows to process
var dataRange = sheet.getRange(startRow, 1, numRows, 5);
var data = dataRange.getValues();
var cal = CalendarApp.getDefaultCalendar();
for (i in data) {
var row = data[i];
var title = row[0]; // First column
var desc = row[1]; // Second column
var tstart = row[5];
var tstop = row[6];
var loc = row[7];
//cal.createEvent(title, new Date("March 3, 2010 08:00:00"), new Date("March 3, 2010 09:00:00"), {description:desc,location:loc});
cal.createEvent(title, tstart, tstop, {description:desc,location:loc});
}
}
列 5 と 6 の値は次のとおりです。
2013 年 2 月 3 日 17:00:00 2013 年 2 月 3 日 18:00:00
デバッグ ツールを起動すると、tstart = undefined および tstop = undefined というメッセージが表示されます。
時間の値を削除すると正常に動作します...しかし、カレンダーに時間の値も必要です...どうすれば修正できますか?
ありがとう..レムコ