I am trying to disable the dates based on list of holidays (Getting from api), and also I want to disable weekdays i.e Saturday and Sunday. I am able to disable list of holidays date, but can't able to disable the weekdays. Here is my code that I have used.
<input matInput [matDatepickerFilter]="holidayDateFilter" [matDatepicker]="picker">
holidayDateFilter = (d: Date): boolean => {
let d = moment(d);
if (this.holidayList) {
return !this.holidayList.find((x) => {
return moment(x).isSame(d, 'day');
})
}
}
Now, where to I put condition for disabling weekends.
Please help me with this. Thanks in advance.