2

How to configure the kendo-angular date picker to show year only on selecting.

tracer
  • 422
  • 2
  • 7
  • 15
  • @mast3rd3mon, did you look into my question. I have asked to show year only in my datepicker not the range which means i should literally show only year on pop up of datepicker – tracer Aug 22 '18 at 09:46

2 Answers2

2

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>
tracer
  • 422
  • 2
  • 7
  • 15
1

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>

More info here : Kendo DatePickerComponent API doc

Sixteen
  • 443
  • 1
  • 4
  • 23