Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

229
Views
TypeError: date.getFullYear is not a function

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.

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!