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

304
Views
How can I disable weekends in q-date using moment business days

I'm using quasar's q-date component in my project. I want to disable weekends and past days while using it. I use the momenten business day library for this, but the moment return an object and q-date cannot detect it. how do you think i can solve this problem

HTML(lang=>pug)

q-date(v-model="userInfo.date" mask="YYYY-MM-DD" :options="getAvailableDate" first-day-of-week="1")

SCRIPT

  getAvailableDate(d) {
      const day = moment(d).format('DD/MM/YYYY')
      console.log(moment(day, 'DD/MM/YYYY').monthBusinessDays())
      return moment(day, 'DD/MM/YYYY').monthBusinessDays() && d >= date.formatDate(Date.now(), 'YYYY/MM/DD')
      
    },
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

You could try passing the date to the function: :options="getAvailableDate(userInfo.date)"

You could test by just returning true or false to check if there is an issue elswhere.

More info on use of v-bind: Vue doumentation Simple explanation

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!