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

145
Views
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 answers
Answer question

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 Report
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!