BugiDev / react-native-calendar-strip

Easy to use and visually stunning calendar component for React Native.
MIT License
939 stars 327 forks source link

how to center pre-selected date in calendar strip when scrollable is true? #229

Closed VanessaChu closed 3 years ago

VanessaChu commented 3 years ago

Given that we have set scrollable to true and have a min and max date, how can we center the pre-selected date in the center of the calendar strip?

Currently, when we first load the calendar strip, the selected date appears on the left. https://www.amazon.com/photos/shared/JuVIRcO9Sqapjy_jJc86PA.c1XBWpf4jmgCk4OZm98IjO What I want to configure is to have the the selected date centered on the strip on first load https://www.amazon.com/photos/shared/DO_KzZv7RWi4QfNd9lvC7A.3sITIXJhPcdoJiyOihFQ_B

peacechen commented 3 years ago

Set startingDate offset such that the selectedDate is centered (e.g. if you want Thursday centered, the startingDate should be on a Tuesday). Also set useIsoWeekday false. https://github.com/BugiDev/react-native-calendar-strip#props

VanessaChu commented 3 years ago

That didn't work with scrollable set to true