2

如何将 kendo-angular 日期选择器配置为仅在选择时显示年份。

4

2 回答 2

1

我已经尝试并获得了以下解决方案,因此如果有人需要,请考虑发布它:

<kendo-datepicker
      [min]="min"
      [max]="max"
      [bottomView]="'year'"
      [format]="'yyyy'"
      [(value)]="value"
  ></kendo-datepicker>
于 2018-08-22T10:52:08.703 回答
1

只显示年份并且只能选择年份,这就是我使用的

<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 DatePickerComponent API doc

于 2021-08-19T15:52:27.620 回答