bibekg / react-schedule-selector

A mobile-friendly when2meet-style grid-based schedule selector
MIT License
147 stars 51 forks source link

Possible to display a given set of dates/times on the schedule without user selection? #67

Open apropp opened 1 year ago

apropp commented 1 year ago

Hello! I currently save users' availabilities in Firebase and want to allow them to update them later. Is there a way i can load the existing schedule onto the rendered schedule selector, so that times/dates they selected previously will appear as dark blue and they can add/remove times as they wish? I have successfully read the data from firebase and saved it to this.state.schedule, but am struggling to get it to display on the selector. Thanks!

bibekg commented 1 year ago

Hello, yes this should be possible by simply initializing your rendering component's state with the previously saved data and passing that into the ScheduleSelector component's schedule prop. Here's an example: https://codesandbox.io/s/react-schedule-selector-initialization-example-74l03t