Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

228
Vistas
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 la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda