shoheiyokoyama / Koyomi

Simple customizable calendar component in Swift :calendar:

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

What happen to 'toDate' parameter in didselect date method in Delegate?

stshelton opened this issue · comments

Having trouble getting end date when using the selection mode "sequence". I had a previous version of this library on a different project and the "didSelect date" method in delegate had a "toDate" parameter that would provide the last date in sequence. Currently, that delegate method only has "didSelect date" which only returns the first date in the sequence even after the user clicked another date to complete sequence. Am I missing another function in the delegate, if not what would be the best method of retrieving the end date of the sequence of dates?

Also, I had an issue with Sat column disappearing when collection view is the same size of the screen. Once I added a trailing and leading constraint of 5 Sat column came back

I'm having these exact two issues too.

  • Sat disappears at bounds.width unless you make it eg. width + 1 and then it's fine.
  • Swift 2.3 version at least: Selecting date prints wrong date (always 1 date behind). Even in the project example this is the case. Eg. Feb 7 shows as Feb 6 when print in console.
  • As described by stshelton, Sequence only captures the first selection. Not only this, but if you select a sequence of dates going forwards, both selects are the same date. But going backwards, it's fine. Eg. Feb 2 (First) and then Feb 7 (second) show as Feb 1 on both clicks (due to the error I outlined before this one). But if you select it the other way, Feb 7 (first) and then Feb 2 (second) then the two selects are different.

Overall these issues make it unusable in its current state, unfortunately, as this is a great lightweight solution.

Same issues with the two guys before, the end selected time is not right

I would agree that the "toDate" parameter should be included again in the "didSelect" method, but as a workaround for now you can use the "shouldSelectDates" method which does include both "date" and "toDate".