Can the jQuery UI Datepicker be made to disable Saturdays and Sundays (and holidays)?

前端 未结 11 679
無奈伤痛
無奈伤痛 2020-11-22 04:02

I use a datepicker for choosing an appointment day. I already set the date range to be only for the next month. That works fine. I want to exclude Saturdays and Sundays f

11条回答
  •  [愿得一人]
    2020-11-22 04:47

    You can use noWeekends function to disable the weekend selection

      $(function() {
         $( "#datepicker" ).datepicker({
         beforeShowDay: $.datepicker.noWeekends
         });
         });
    

提交回复
热议问题