richardtop / CalendarKit

📅 Calendar for Apple platforms in Swift
https://www.youtube.com/watch?v=cJ63-_z1qg8
MIT License
2.52k stars 340 forks source link

Setting custom initial date results in a bug when swiping right #263

Closed MockinMan closed 4 years ago

MockinMan commented 4 years ago

New Issue Checklist

Issue Description

I've found the bug with setting the initial date. If the initial date is not today when swiping right will lead not to the next day, but to today one. I've found out that this most likely happens because in TimelineContainerController TimelineView instance is set with today. I've experienced it in both my project (which is built on SwiftUI) and example.

Code I'm using with CalendarKit

override func viewWillAppear(_ animated: Bool) {
    super.viewWillAppear(animated)
    move(to: myDate)
}

Result I am trying to achieve

Change the initial date when showing the calendar and get correct swiping behavior.

What happens

The initial date is shown as needed, but swiping right will scroll not to the NEXT date, but today one.

richardtop commented 4 years ago

Fixed in 0.13.11