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

386
Views
Selector de fechas Habilitar días específicos de la lista

Estoy tratando de desarrollar un sistema de citas. Traté de habilitar las fechas disponibles en un selector de fechas, pero el problema es que solo habilita un día.

 $('#doctor').on('change', function() { var drId = this.value; $('#timetable').html(''); $.ajax({ url: '{{ route(' getTimes ') }}?dr_id=' + drId, type: 'get', success: function(res) { console.log(res); $('#timetable').html('<option value="">Select Day Time</option>'); $.each(res, function(key, value) { const weekday = [, "Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Satarday"]; const d = new Date(); //Disabled by Day Name $(document).ready(function() { $('#datepicker').datepicker({ beforeShowDay: filterDays }); }); // getDay() method returns the day of the week (from 0 to 6) where // Sunday is 0, Monday is 1, and so on. function filterDays(date) { var day = date.getDay(); //return true only if day is Wed or Fri or Sun return [day[value.day_name]] } $('#timetable').append('<option value="' + value.id + '">' + value.start_time + value.end_time + '</option>'); }); } }); });

Aquí return [day[value.day_name]] muestra solo el domingo, pero hay otros 3 días almacenados en la base de datos. Solo pasa un único valor.

Por favor, ayúdame a hacer esto.

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