如何让 kendo-angular-datepicker 只显示年份
How to make a kendo-angular-datepicker to show year only
如何配置 kendo-angular 日期选择器以仅在选择时显示年份。
我已经尝试并得到了以下解决方案,所以考虑发布它以防万一有人需要:
<kendo-datepicker
[min]="min"
[max]="max"
[bottomView]="'year'"
[format]="'yyyy'"
[(value)]="value"
></kendo-datepicker>
只显示年份并且只能 select 年份,这就是我使用的
<kendo-datepicker
format="yyyy" <!-- Shows year only inside the textbox -->
activeView="decade" <!-- Starting point inside the popup -->
bottomView="decade" <!-- Can't navigate down in the popup -->
topView="decade" <!-- Can't navigate up in the popup -->
<!-- Add more option below as needed -->
></kendo-datepicker>
如何配置 kendo-angular 日期选择器以仅在选择时显示年份。
我已经尝试并得到了以下解决方案,所以考虑发布它以防万一有人需要:
<kendo-datepicker
[min]="min"
[max]="max"
[bottomView]="'year'"
[format]="'yyyy'"
[(value)]="value"
></kendo-datepicker>
只显示年份并且只能 select 年份,这就是我使用的
<kendo-datepicker
format="yyyy" <!-- Shows year only inside the textbox -->
activeView="decade" <!-- Starting point inside the popup -->
bottomView="decade" <!-- Can't navigate down in the popup -->
topView="decade" <!-- Can't navigate up in the popup -->
<!-- Add more option below as needed -->
></kendo-datepicker>