Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can't use Angular Material date range date filter

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)

like image 711
Ahmad ElBatanouni Avatar asked Oct 12 '25 17:10

Ahmad ElBatanouni


1 Answers

Adapting the dateFilter 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.

like image 113
homersimpson Avatar answered Oct 14 '25 14:10

homersimpson