jQuery datepicker disable sundays & specific array of dates

后端 未结 2 704
执念已碎
执念已碎 2021-01-21 02:13

I\'ve gotten pretty far with this but stuck on the last part. I basically just need to disable all sundays and then be able to add dates to an array to also be disabled, I know

2条回答
  •  耶瑟儿~
    2021-01-21 02:41

    try this

    beforeShowDay: function(date) {
        var day = date.getDay();
        var string = jQuery.datepicker.formatDate('yyyy-mm-dd', date);
        if (day == 0){
          return [false];
        }
        else if(array.indexOf(string) != -1){
          return [false];
        }
        else{
          return [true];
        }
     }
    

提交回复
热议问题