christopherdro / react-native-calendar

[DEPRECATED] Calendar Component for React Native
MIT License
536 stars 244 forks source link

Feature request: Multi-selection #2

Open PhilippKrone opened 9 years ago

PhilippKrone commented 9 years ago

Hi,

I'd be nice to be able to select multiple dates by swiping from a start date to an end date (or simply clicking both days after each other).

In case I can support, drop me a line here. :)

Regards Philipp

christopherdro commented 9 years ago

Could you provide a use case?

If you want to specify a 'end date', you can try and have that as a DatePickerIOS component on the next screen that is pushed to the view.

Take a look at the iPhone's calendar app and how adding events works.

oblador commented 9 years ago

+1 See Airbnb app for use case and good implementation (uses two taps).

jdmunro commented 9 years ago

Being able to view a list of events within a date range is one possible use case. I have something similar in mind for an app I am working on. I can see that there will be a few other changes I might make too, I might be able to spin off a couple of pull requests.

adamkrell commented 9 years ago

I have a use case where I want to select a whole week. Sometimes you want to display data about the week and having the calendar picker indicate that the week is selected would be a nice UI option.

jdmunro commented 9 years ago

If anyone is interested, I've implemented basic multi-selection in my branch. You should be able to use the example to see how it works: https://github.com/jdmunro/react-native-calendar/tree/multi-select

Basically I've implemented it so you can set a selected start date and end date to create a range. I updated the date selected callback to receive both the start date and end date. I've handled the situation where the end date you might select is chronologically before the start date, in this case it switches them round.

dorthwein commented 9 years ago

+1 as well as multiple select where the result is an array with selected values. Single tap for each date added.

francisrod01 commented 6 years ago

Is this was considered?