Good evening! As for title, I’m working with MaterializeCSS (without jQuery because I’m in ReactJS), and I’m trying to write a function to pass to disableDayFn, such that every weekday but Mondays and Thursdays are DISABLED. I wrote this
M.Datepicker.init(datepicker, {
disableWeekends: true,
autoClose: true,
firstDay: 1,
yearRange: 1,
showDaysInNextAndPreviousMonths: true,
showClearBtn: true,
defaultDate: (() => Date.now()),
disableDayFn: ((callbackDay) => {
let today = new Date();
today = Date.now();
let day = new Date();
if(callbackDay < today && (day.getDay() != 1 || day.getDay() != 4)) {
return true;
} else {
return false;
}
})
});
but it’s not working. Can anybody address the issue?