I wanna set disable for weekend and holiday in jQuery Datepicker. But, the holidays are from my array. I try to create the code like below. What should I do?
$( function() { var holidays = ["2017-01-01","2017-01-28","2017-02-15","2017-03-28","2017-04-14" ,"2017-04-24","2017-05-01","2017-05-11","2017-05-25","2017-06-01" ,"2017-06-25","2017-06-26","2017-06-27","2017-06-28","2017-06-29" ,"2017-06-30","2017-08-17","2017-09-01","2017-09-21","2017-12-01" ,"2017-12-25" ]; $( "#datepicker" ).datepicker({ beforeShowDay: function(date){ var datestring = jQuery.datepicker.formatDate('yy-mm-dd', date); return [ holidays.indexOf(datestring) == -1 ]; }, beforeShowDay: $.datepicker.noWeekends, MinDate : '0', changeMonth :true, changeYear : true, yearRange: "c-40:+c+0" }); } ); What should I do? Thanks in advance