Skip to content
This repository has been archived by the owner on Apr 3, 2023. It is now read-only.

Add support for multiple days/range selections #32

Open
victorpinheiro opened this issue Oct 27, 2020 · 2 comments
Open

Add support for multiple days/range selections #32

victorpinheiro opened this issue Oct 27, 2020 · 2 comments

Comments

@victorpinheiro
Copy link

Is it possible to set multiple days or multiple ranges as default selection?
Couldn't find anything about this on documentation

@GiovanniFrigo
Copy link
Member

As for the current design, only one date or range are supported in the selection by the user, so the same applies to the default selection.

I may consider adding the support for it in the future!

@GiovanniFrigo GiovanniFrigo changed the title Multiple default days/range selections Add support for multiple days/range selections Nov 13, 2020
@chavda-bhavik
Copy link

@victorpinheiro @GiovanniFrigo We can use customClasses with state to select multiple dates.
const [ dates, setDates ] = useState([]);

<Calendar
  year={2021}
  onPickDate={ date => setDates([ ...dates, date.format('MM/DD/YYYY') ]) }
  customClasses={{
    selected: day => dates.includes(day.format('MM/DD/YYYY'))
  }}
/>

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants