JTAppleCalendar: SelectedPosition problem when config generateInDates or generateOutDates

with these configuration of calendar:

ConfigurationParameters(startDate: startDate, endDate: endDate, generateInDates: .off, generateOutDates: .off)

then cellState.selectedPosition() returns wrong response in start and end of month. you have an 2tapRangedSelection example, you can edit it and see wrong result.

About this issue

  • Original URL
  • State: open
  • Created 4 years ago
  • Comments: 19 (17 by maintainers)

Most upvoted comments

Ah. Let me clear it up. Here indates/outdates are generated and visible.

Screen Shot 2020-05-16 at 10 22 25 AM

Here indates/outdates are generated and hidden/invisible.

Screen Shot 2020-05-16 at 10 23 41 AM

Here indates/outdates are not generated at all. And therefore are not visible.

Screen Shot 2020-05-16 at 10 24 42 AM

So there is difference between generating them and hiding them.

With the solution i plan to implement, I will be handeling the visibility (not the generation). Based on the visibility, i can fix how the range looks. The decision to generate/not generate will not be handled by the library. It will be handled by the developers.

Ok yea, the fix will work. But other developers wont be happy.

Therefore i have determined the ultimate solution for this. This library needs to create a new set of functions.

calendarView.showIndates()
calendarView.hideIndates()
calendarView.showoutDates()
calendarView.hideOutDates()

Because the problem is that i let the developers determine when to show or hide the indates/outDates on their own. Because of this, the library does not know when a developer has done this. And because I do not know, I cannot suggest the best visual way the range selection should look.

However, if this library now begins to manage the visibility/invisibility of the inDates/OutDates, Then i will know how to adjust what the ranged left, right, middle should look like.

Keep in mind, i know how to fix your issue. However, if i code it the way you want, then other developers might not like the new behavior. Therefore, let me test an edgecase fix for this case when the final day lands on end of index. Be right back.

this ?

calendarView.rangeSelectionMode = .continuous
calendarView.rangeSelectionMode = .segmented