New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
scrollToDate() scrolls to the OutDates of the previous month (Edge case) #1239
Comments
If you have a sample app reproducing this, it can help. |
The project is pretty large, I don't want to share the whole thing. I also have a little issue where the function "didSelectDate" doesn't get called on cell touches. "didSelectDate" is on line 128 |
I understand you cant share the whole thing. Crashes (or bugs like crashes) or other obvious errors can be solved by me easier than the error you currently have. Anything can cause it, from xibs, to code. Therefore a sample app can help me see exactly what the problem is. If i just have the file, then i will have to create a project around it which might behave differently than your current one; |
I understand, I'll try to do that ASAP. |
Ok i just awoke. BTW, scroll to date should never scroll to outDates. It should always scroll to the correct date stated by you. Checking this out now. |
Update: didSelectDate function issue was fixed by going to the Size Inspector on DateCell and changing the Collection View Cell Size from Automatic to Custom, and un-checking Content View This also fixed all the console errors regarding constraints after the calendar renders. Should I open a separate issue for this and then close it? |
no, its ok. As for the scroll to date, it works as expected on my end. |
Im on the US West Coast. So even without modifying anything in the project it scrolled to the correct month? Also, even after setting generateOutDates: .none is still scrolls to the month prior, even if the date cells are not showing at all. EDIT: I don't think this is a timezone issue, because its' error margin lies across 4 days in this case (April-March). That is: scrolling to any of the dates that also lie as outDates of the previous month, will scroll to the previous month. |
Ok you were probably right about that one, I don't know exactly what I did, but I messed around come Calendar() settings, and was trying to make things more consistent and it work now. Cheers. |
awesome |
I have the same bug in my code. Calendar is scrolling to prior month due to outDates appearing. I made a workaround by changing the scrollToDate to be the middle of the current month instead of using today's date. |
(Required) Version Number: 8.0.2
Description
scrollToDate() scrolls to the OutDates of the previous month if they exist.
E.G. April 4th 2020 also lies as the last (OutDates) item on the calendar of March. So it scrolls to march instead.
Conversely, scrollToDate(date_object) - where date_object is April 5th 2020, would result in the correct month placement. Because April 5th does not lie on the OutDates of march.
Steps To Reproduce
Expected Behavior
Expecting to land on the April month, but it landed on March
Additional Context
A very nasty workaround is by making a generic Date() object using DateComponents() and setting the date to 15 and copying the rest. I don't really care about the specific date, I just need the correct/current month.
It looks like this:
Also, why not have something like scrollToMonth()?
I also checkout the scrollToMonth definition, but wasn't able to understand many of it :/
This is my first app.
Nonetheless, wonderful framework 👍
Thank you for time spent developing and maintaining.
The text was updated successfully, but these errors were encountered: