'TypeError: date.getFullYear is not a function [duplicate]
I'm getting this error in the first function when i run the second one
function removeTime(date) {
if( typeof date === "string" ) date = new Date(date);
return new Date(date.getFullYear(),date.getMonth(),date.getDate());
}
function DailyPODashboard(){
const ss = SpreadsheetApp.openByUrl(THIS).getSheetByName("Daily PO Dashboard");
var date = new Date();
var wn = Math.floor(WEEKNUMBER(date));
var data = weekReview(wn);
Logger.log(typeof data[4][17])
for(var row=0; row<data.length; row++){
var d1 = new Date();
Utilities.sleep(100);
var d2 = new Date();
console.log(d1);
console.log(d2);
console.log( d1.valueOf() === d2.valueOf() );
data[row][17] = removeTime(data[row][17]);
d1 = removeTime(d1);
console.log(d1);
console.log(data[row][17]);
console.log( );
if(d1.valueOf() === data[row][17].valueOf()){
Logger.log(" I'm in!")
ss.getRange('B3:AA').setValue(data[row]);
}
}
where data includes big number of data and column 17 has the dates
been struggling with this for too long, so would really appreciate the help.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
