I need to exclude Monday and Tuesday from a datepicker throughout the year, but need to allow this during the holiday season for 2020-12-21 and 2020-12-22.
How could I counter the day != 1 && day != 2 and only use this if not one of the above dates?
var excludeDates = ["2020-12-24","2020-12-25","2020-12-26","2020-12-27","2020-12-28","2020-12-29","2020-12-30","2020-12-31","2021-01-01","2021-01-02","2021-01-03",,"2021-01-04","2021-01-05","2021-01-06"];
$( function() {
$( "#roves_collection_date" ).datepicker({
minDate : advanceCollection,
dateFormat: 'dd/mm/yy',
altFormat: 'yy-mm-dd',
beforeShowDay: function(date) {
var day = date.getDay();
var string = jQuery.datepicker.formatDate('yy-mm-dd', date);
return [(day != 1 && day != 2 && excludeDates.indexOf(string) == -1];
}
});
});