stephy / CalendarPicker

CalendarPicker Component for React Native
792 stars 369 forks source link

Manually set `selectedStartDate` and scroll to month #127

Closed SMJ93 closed 6 years ago

SMJ93 commented 6 years ago

First of all, awesome library! So easy to setup and use!! Thank you 😄

We need to add some functionality so we can jump to the next quarter (a few months in advance). We can set the selectedStartDate to a value which updates the calendar value as expected, but it doesn't scroll to the correct month.

E.g. I may be in June and click next quarter, it selects the 1st of September, but doesn't scroll to the September month.

Thanks!

peacechen commented 6 years ago

Try passing in the initialDate prop. The calendar will update as that prop changes. https://github.com/stephy/CalendarPicker#calendarpicker-props

SMJ93 commented 6 years ago

That worked! Thank you @peacechen