Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

232
Visualizações
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
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda