[英]How to remove the focus from today's date in Angular Material Datepicker?
Is it possible to remove the focus on today's date when using Angular Material datepicker?使用 Angular Material datepicker 时是否可以移除对今天日期的关注? I have tried adding the following properties to mat-datepicker but nothing seems to work and I can't find a way to do this:
我尝试将以下属性添加到 mat-datepicker,但似乎没有任何效果,我找不到方法来做到这一点:
<mat-form-field appearance="fill">
<mat-label>Choose a date</mat-label>
<input matInput [matDatepicker]="picker">
<mat-datepicker-toggle matSuffix [for]="picker"></mat-datepicker-toggle>
<mat-datepicker #picker></mat-datepicker>
</mat-form-field>
For example, I don't want the focus/background on 16 in the image below.例如,我不希望下图中 16 的焦点/背景。
I need to do this because I am trying to use Angular Material datepicker for the users to enter their date of birth and the focus on today's date is irrelevant in this case.我需要这样做,因为我正在尝试使用 Angular Material datepicker 让用户输入他们的出生日期,在这种情况下,今天的日期无关紧要。
apply This class inside style.css file of your project and re run project again.. Basically you need to change default css class implementation.在你的项目的 style.css 文件中应用这个类并重新运行项目。基本上你需要更改默认的 css 类实现。
.mat-calendar-body-today:not(.mat-calendar-body-selected):not(.mat-calendar-body-comparison-identical) {
background-color: rgb(255 255 255) !important;
border: none !important;
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.