jQuery UI Datepicker - allow only certain weekdays

后端 未结 5 535
我在风中等你
我在风中等你 2020-12-17 21:56

I\'m using jquery UI datepicker on a huge project and I realize now that I\'ll need to allow only certain weekdays on some areas. I read their documentation and didn\'t find

5条回答
  •  [愿得一人]
    2020-12-17 22:20

    $( ".datepicker.future" ).datepicker('option','beforeShowDay',function(date){
        var td = date.getDay();
        var ret = [(date.getDay() != 0 && date.getDay() != 6),'',(td != 'Sat' && td != 'Sun')?'':'only on workday'];
        return ret;
    });
    

提交回复
热议问题