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

303
Views
¿Cómo deshabilitar horas específicas en fechas específicas en jquery datetimepicker (xdan)?

Estoy usando jQuery DateTimePicker . Quiero deshabilitar algunas horas específicas en algunas fechas específicas. Por ejemplo, quiero deshabilitar las 09:00AM a. m. del 29/03/2022 y 10:00AM a. m. del 30/03/2022 .

Ya encontré este código, pero no funciona. El calendario en línea se está ejecutando correctamente.

 var specificDates = ['29/03/2022', '30/03/2022']; var hoursToTakeAway = [ [09, 10], [10] ]; onGenerate: function(ct, $i) { var ind = specificDates.indexOf(ct.dateFormat('d/m/Y')); $('.xdsoft_time_variant .xdsoft_time').show(); if (ind !== -1) { $('.xdsoft_time_variant .xdsoft_time').each(function(index) { if (hoursToTakeAway[ind].indexOf(parseInt($(this).text())) !== -1) { $(this).hide(); } }); } }

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

EL CÓDIGO FINAL ESTÁ FUNCIONANDO: (estoy usando momentjs para usar la función de momento en ct)

 onGenerate: function(ct,$i) { var ind = specificDates.indexOf(moment(ct).format('DD/MM/YYYY')); $('.xdsoft_time_variant .xdsoft_time').show(); if(ind !== -1) { $('.xdsoft_time_variant .xdsoft_time').each(function(index){ if(hoursToTakeAway[ind].indexOf(parseInt($(this).text())) !== -1) { $(this).addClass('xdsoft_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!