Reputation: 268
I am looking for a function that can disable weekends on my datepicker. I know that I can use isDayDisabledCallback to disable dates but how can I only disable weekends.
<dp-date-picker [(ngModel)]="selectedDate" [config]="datePickerConfig"></dp-date-picker>
Upvotes: 0
Views: 694
Reputation: 1242
In the configuration you can set the callback isDayDisabledCallback like that for exclude Saturday and Sunday.
config = {
isDayDisabledCallback: (date) => [0, 6].includes(date.day())
};
Upvotes: 1