react-native-calendar-strip icon indicating copy to clipboard operation
react-native-calendar-strip copied to clipboard

Possible to select multiple days

Open mgit7 opened this issue 7 years ago • 6 comments

Is it possible to select multiple days and have them all contain same "selected style"?

mgit7 avatar Feb 01 '18 01:02 mgit7

Currently CalendarStrip only supports one selected day at a time. A new prop would need to be added to enable multi day select, as well as changes to the return value of the onDateSelected callback, retaining backwards compatibility.

Are you trying to select a date range (contiguous dates), or an arbitrary set of dates possibly with gaps between?

PR's are welcome :)

peacechen avatar Feb 01 '18 16:02 peacechen

I am trying to set an arbitrary set of days with gaps between the days. This should essentially return a list of days that are selected.

mgit7 avatar Feb 01 '18 23:02 mgit7

Has anyone been able to implement this? If not, I can try to submit a PR.

mgit7 avatar Apr 23 '18 20:04 mgit7

I implemented this in a project by only adding a onDateLongPress prop to calendardate. The parent component used this to know when it is in date range mode and passed appropriate styles for the dates.

tyricec avatar Apr 23 '18 21:04 tyricec

I have been added "onDateLongPress" but nothing to happen. Someone can share me the code to select multi days !!

screen shot 2018-10-16 at 10 55 40 am

trancanh2202 avatar Oct 16 '18 04:10 trancanh2202

@trancanh2202 This is a free and open source project. If you'd like to see a feature, you are welcome to implement it and submit a PR. I'm not sure how @tyricec did his implementation, but it sounds like he used customDatesStyles to work around it. It would be cleaner to implement it within CalendarStrip. It's relatively well organized and shouldn't be too difficult to understand how it works internally.

peacechen avatar Oct 17 '18 20:10 peacechen