Reputation: 442
How to configure the kendo-angular date picker to show year only on selecting.
Upvotes: 2
Views: 3438
Reputation: 563
To show year only and be able to select year only, this is what I use
<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>
Copy-Pastable
<kendo-datepicker
format="yyyy"
activeView="decade"
bottomView="decade"
topView="decade"
></kendo-datepicker>
More info here : Kendo DatePickerComponent API doc
Upvotes: 2
Reputation: 442
I have tried and got the below solution, so thought of posting it if in case anyone needs:
<kendo-datepicker
[min]="min"
[max]="max"
[bottomView]="'year'"
[format]="'yyyy'"
[(value)]="value"
></kendo-datepicker>
Upvotes: 2