One aproach can be you binding the dateclass
to a function that return a function (date: Date)=>string|null)
Imagine some like
dateClass(type:any) {
switch (type)
{
case 0:
return (date: Date): MatCalendarCellCssClasses => {
...
}
break
case 1:
return (date: Date): MatCalendarCellCssClasses => {
...
}
break
}
You can to have a variable type and use
<mat-datepicker [dateClass]="dateClass(type)">...</mat-datepicker>
But take account that the "dateClass" function is executed only when you open the datepicker or when you change the month (one time for each day)
I feel you're looking for some like this SO. Well, you can take the aproach and call to the function "changeMonth" when you make a click