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

267
Views
¿Cómo usar habilitar y deshabilitar propiedades juntas en flatpickr.js?

No puedo usar las propiedades de habilitar y deshabilitar juntas en flatpickr.js. En realidad, habilitar la propiedad está devolviendo un rango de fechas que deberían habilitarse, pero quiero deshabilitar días específicos, digamos fines de semana entre ese rango de días habilitado.

 datePickerInput.flatpickr({ clickOpens: false, disableMobile: 'true', // Do not render mobile version UI closeOnSelect: false, defaultDate: null, enable: [getEnableDays()], disable: [ function (date) { return (date.getDay() === 0 || date.getDay() === 6); } ], locale: { "firstDayOfWeek": 1 } }); getEnableDays: function () { var me = this; var maxDate = '2090-12-25T16:16:22.585Z'; var minDate = '1900-12-24T16:16:22.585Z'; var fromDate = minDate; var toDate = maxDate; if (me.disableDays) { fromDate = me.isPrevDaysDisable ? me.calculatedDate.toISOString().slice(0, 10) : 'today'; toDate = !me.isPrevDaysDisable ? me.calculatedDate.toISOString().slice(0, 10) : 'today'; } return { from: fromDate, to: toDate, }; },
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

No puede usar deshabilitar junto con habilitar, pero así es como puede lograr deshabilitar la funcionalidad de fines de semana pero usando onDayCreate.

 onDayCreate: function (dObj, dStr, fp, dayElem) { if (dayElem.dateObj.getDay() === 0 || dayElem.dateObj.getDay() === 6) { dayElem.className += " flatpickr-disabled nextMonthDayflatpickr-disabled"; } },
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!