Open jasonmichaels opened 4 years ago
A drawing would help me better understand what you're envisioning. A couple scenarios:
You can use the headerText
prop to customize the header. Listen to onDateSelected
and set headerText accordingly.
https://github.com/BugiDev/react-native-calendar-strip#props
If you want the selected date to display in the week view along with the other dates, that is not currently supported. IMHO it would be awkward to have a date overlaid on top of the week view, obscuring a day's worth of space. Anything under the centered date wouldn't be selectable or cleanly visible.
You could implement this independently of the library by creating an absolutely positioned view over the CalendarStrip. Listen to onDateSelected
and update the overlaid view with the date render.
PR's are welcome and I encourage you to contribute back to this project.
Hi peacechen, thank you for the response. I think Jason's case is the same one that we currently require. So to elaborate, lets say you select the 1st (lets say its a 5) item in the strip, then the lists rotates to make that item the 4th item in the list (the middle item). So now 5 will display in the middle as the 4th item. Is that currently possible?
Thanks!
That would be possible when used with the scollable
prop. A new method e.g. scrollToDate
would need to be exposed. Please submit a PR with that feature.
TBH while that sounds great in theory, it would be disruptive for users. Every time they click on a date, the calendar strip spontaneously scrolls away (in your example it would scroll backwards a few days).
First off, love the
CalendarStrip
component. I may ultimately fork it to add functionality and then check back in if I'm able to do these myself. Here's the request -- if it's possible with the current props, though, let me know!Scenario:
As a user, I want to select a date and have the strip automatically center that date. Until I select another date, the currently selected date should stay centered. UX-wise, this means dates would scroll behind the centered date until a new date is selected; once selected, the new
selectedDate
would automatically center.