jQuery UI Datepicker check if given date is Disabled or not

Viewed 45

I am working on Online Class Booking Project in which I am getting dates array dynamically.

For example : if a student has selected a particular date range and selected classes for every Monday, then using jQuery , I am retrieving all the Monday from that selected date range.

I am getting array as shown below.

var all_dates = ['07/25/22', '08/01/22', '08/08/22', '08/15/22', '08/22/22', '08/29/22', '09/05/22', '09/12/22', '09/19/22'];

Now I want to set a date in the calendar , for that I am using the following code $('#booking_calender').datepicker('setDate', all_dates[0]);

Here is one more condition, Teachers have set their avaiblity , so if the teacher is not available on '07/25/22' then it should select the next date.

on calendar , if the teacher is not available then that date is disabled ( Please check the screenshot ).

enter image description here

So , my question is , before setting a date , how will I check if the date is disabled or not.

0 Answers
Related