I'm looking to build an angular-material datepicker (Angular Material 11), but I have a small feature that's needed and I just can't seem to crack.
It needs to look like in the picture below:
The problem I have is with the extra text that appears in each of the day cells. I've tried the [dateClass] attribute but to no avail:
template:
<mat-datepicker [dateClass]="dateClassArrow"></mat-datepicker>
.ts component:
constructor(availableItemsService...) {}
dateClassArrow = date => {
const noItems: string = this.availableItemsService.getAvailableItems(date);
document.documentElement.style.setProperty('--availableItems', noItems);
return 'class-that-contains-content';
}
.scss
:root {
--availableItems: 1;
}
.class-that-contains-content {
...
}
.class-that-contains-content:before {
content: --availableItems;
}
Also tried without the :before, like
.class-that-contains-content {
content: attr(--availableMaterials);
}
Any hints or help would be appreciated.