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

前端 未结 11 790
無奈伤痛
無奈伤痛 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:48

    The datepicker has this functionality built in!

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

    http://api.jqueryui.com/datepicker/#utility-noWeekends

提交回复
热议问题