![](/img/trans.png)
[英]Angular Material Calendar set always focus on today's date day
[英]How to remove the focus from today's date in Angular Material Datepicker?
使用 Angular Material datepicker 時是否可以移除對今天日期的關注? 我嘗試將以下屬性添加到 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>
例如,我不希望下圖中 16 的焦點/背景。
我需要這樣做,因為我正在嘗試使用 Angular Material datepicker 讓用戶輸入他們的出生日期,在這種情況下,今天的日期無關緊要。
在你的項目的 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.