I have an array of days, which can be from any year. I am attempting to customize the Angular Material datepicker to highlight specific months and years in the selection views based on the array of days.
.html
<input [matDatepicker]="picker" />
<i class="fas fa-chevron-down"></i>
<mat-datepicker #picker></mat-datepicker>
.ts
arrayOfDays = [new Date('2019-01-01'), new Date('2020-08-10'), new Date('2020-09-20')];
The goal is to highlight the years 2019 and 2020 in the year view, and if 2019 is selected, then highlight the month of January, and if 2020 is selected, then highlight the months of May & August with a red border, excluding the current month and year as shown in the images below.
https://i.sstatic.net/C2PtG.jpg https://i.sstatic.net/QqSPp.jpg
Is this feasible?
I have researched extensively and attempted various methods such as dateClass, (yearSelected) event, but have not been successful in applying them for Months and Years views. If anyone has knowledge on how to achieve this, kindly provide assistance.
For your information - https://stackblitz.com/edit/angular-date-class-filter-aactjv was one solution I found for customizing dates view, however, I am seeking similar implementation for Year and Month views.
Thank you in advance.