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

147
Vistas
add days to date using vuejs

in the data function I have created tomorrow variable with the date of today then I have set it by appenden 1 day to it but I'm getting this error

data(){
return{
  tomorrow: new Date(),
  tomorrow.setDate(tomorrow.getDate() + 1),
};
},

error Parsing error: Unexpected token .

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

The data property is design for storing variables, not invoking functions or adding logic like you're trying to do.

Try computed property:

computed: {
  tomorrow() {
    const d = new Date()
    d.setDate(d.getDate() + 1)
    return d 
  }
}

And then in your template you can do {{ tomorrow }} or in your vue component this.tomorrow

about 4 years ago · Juan Pablo Isaza Denunciar
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