Reputation:
I've a DatePicker
<DatePicker/>
in my component and it is rendered correctly, everything works properly but I need in my special use case only year view.
There is a function in a child component of DatePicker (Calendar):
yearSelector()
and it will called if I click on the year:
My question is: How can I call it programmatically, as far as DatePicker rendered in my component, so that I see only the year view like below:
Upvotes: 3
Views: 6101
Reputation: 609
So if I understand, you want to force your calendar to first ask the user to select a year?
You can try this :
openToYearSelection={true}
You can see this code on datepicker documentation and the pullrequests
Upvotes: 1