Closed rameswarprasad closed 5 years ago
yea... this is expected. This was the way i coded it. Another developer pointed the same thing you mention here --> https://github.com/patchthecode/JTAppleCalendar/issues/1096
We came to a conclusion that i needed an update because if i code it one way, some devs will be happy while the other devs will be upset. So in the update mentioned on that page, i proposed a middle ground.
Since the other issue is tracking this, I'll close this one and try to get an update soon. In the mean time, you'll have to use a different logic to find the Mid/start points.
Another developer also made a push on that thread to do a fix. But I have not had the time to look at it yet. closing this issue. Lets track it there
I just merged the fix. Can you let me know if it works for you?
The calendar should now have 2 modes.
calendarView.rangeSelectionMode = .continous OR calendarView.rangeSelectionMode = .segmented
In order to test this you'll have to use master branch. If you are using XCodeBeta, then you can just use SwiftPackageManager for this. Let me know if you need further help with it.
(Required) Version Number: 8.0.1
Description
When ranged selection is available I found an issue which I think is a bug. Please look at the attached image:
Here the
cellState.selectedPosition()
for 1st Feb is returned as.left
instead ofmiddle
.Steps To Reproduce
Here I just called
selectDates
method programmatically on the calendar view with 31st Jan as start date and 2nd Feb as endDate.Expected Behavior
The value should return
.middle
for 1st Feb when calledcellState.selectedPosition()
Additional Context
Also, I'm attaching some demo example so it's easier to play around instead of reimplementing the same thing.
Link to Demo: https://www.dropbox.com/s/5gpwwyhj9nm6p9e/CalendarDemo.zip?dl=0