jQuery UI DatePicker检查是否禁用了日期

发布于 2025-02-11 07:17:01 字数 757 浏览 0 评论 0原文

我正在从事在线课程预订项目 在其中,我动态地获得了日期。

例如:如果学生选择了每个星期一的特定日期范围和选定的类,则使用jQuery,我将从选定的日期范围内检索所有星期一

我的数组如下所示。

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'];

现在我想在日历中设置一个日期, 为此,我正在使用以下代码 $('#booking_calender')。datePicker('setDate',all_dates [0]);

这是一个条件,教师设置了他们的avaiblity,因此,如果教师在上不可用,则'07/25/22',它应该选择下一个日期。

在日历上,如果老师不可用,则该日期已禁用(请检查屏幕截图)。

那么,我的问题是,设置日期之前,我将如何检查日期是否被禁用。

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.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文