Reputation: 2434
I have changed the format of the text of this button. The problem I am facing that it automatically changes the text to the upper case. I want to make it title case (just first letter is capital the rest of the letters are lower cases). Is there any way to do this?
Upvotes: 1
Views: 2084
Reputation: 175
You have to use a bit of css there:
.mat-calendar-period-button {
text-transform: lowercase;
&::first-letter {
text-transform: uppercase;
}
}
Upvotes: 1
Reputation: 2120
This comes from MatCalendarHeader
. Looking at the template the month and the year comes from periodButtonText. Looking further in the code perioduttonText
is a getter and at the end they called toLocaleUpperCase. So there is no build in way to change this.
What you can do is change the calendar header with your template like is shown in this Stackblitz.
Upvotes: 0