我有一個停止工作的Google App腳本,並在對象17中引發錯誤「TypeError:Can not find getHours in function 17.」。由於我們沒有對代碼進行任何更改,而且我對Google App Script/Javascript也不太熟悉,所以我希望有人能指出我的正確方向。TypeError:在對象17中找不到函數getHours
的代碼比這更長的時間,但我給調用getHours功能的外觀的例子(我可以提供完整的代碼如果需要的話):
if (action.indexOf("[") == -1 && action != "") { // Check if there is some operation to take action
var roomtype = row[1]; // Reading data from the table
var desc = row[8];
var date = row[2];
var tstart = row[3];
var tstop = row[4];
var name = row[5];
var company = row[9];
var short_title = RoomShortcuts[0][roomtype] + " " + name + " (" + company + ")"; // Creating title of the Calendar entry
if (action == "Tentative") { short_title = "PROV: " + short_title; } // This is for Tentative events
var year = date.getYear(); // Getting the date and time and transforming it for the calendar
var month = date.getMonth();
var day = date.getDate();
var startHour = tstart.getHours();
var startMinute = tstart.getMinutes();
var stopHour = tstop.getHours();
var stopMinute = tstop.getMinutes();
var startdate = new Date(year, month, day, startHour, startMinute);
var stopdate = new Date(year, month, day, stopHour, stopMinute);
if (roomtype == "Gallery") {
var repeat = 2;
cal_EventCalendar[0]['Gallery'] = CalendarApp.openByName("Hub SMR");
} else {
var repeat = 1;
}
非常感謝!
你可以發佈'行'的內容嗎?我想隱式轉換爲'日期'是爲'日期'var發生,但不是'tstart'和'tstop'。 – bfavaretto