Can't use Angular Material date range date filter

5.9k views Asked by At

I'm trying to use the new date range picker from Angular Material and I need to filter out some certain days (min and max won't be helpful for me here). I used before "matDatepickerFilter" with the normal date picker but I can't find the same thing for the date range picker so I tried instead using "dateFilter".

The problem is that after applying the function I can't select any dates at all.

Here's a code sample of what I mean (stackblitz)

1

There are 1 answers

1
zerocewl On BEST ANSWER

Adapting the dataFilter definition for mat-date-range-input in the Template should fix your issue.

<mat-date-range-input [rangePicker]="picker"  [dateFilter]="rangeFilter">

Here is a working version of your Stackblitz.