Supporting marking on a range of dates by simply pass a start and an end date #1286
See original GitHub issuehttps://github.com/wix/react-native-calendars/issues/1286#issue-694098729
Description
Is there a way which allows me to simply pass the start date and the end date of a date range as the props, so the entire date range will automatically be marked on the calendar?
So far I have to implement it by working out a list containing all the dates in this range, and pass them as an bulky object with attributes like selected
and color
for each single date.
I read through the read.me file and I assume this is the only offical documentation? I’d like to know if there’s a better way to implement this. Otherwise I’ll make a suggestion about this feature. Thanks.
Expected Behavior
Click a start date, click an end date, all dates in this range will be selected.
Like that:
I got it from another package.
Observed Behavior
Only exact dates in an object passed to markedDates will be marked. If there’re 20 days, I have to pass 20 different dates in.
If there’s an error message, please paste the full terminal output and error message in this code block:
N/A
Environment
N/A
Reproducible Demo
N/A
Issue Analytics
- State:
- Created 2 years ago
- Reactions:6
- Comments:6
@nguyenvantruong17 I found the following code
I wrote this code for functional components.