I've been having issues with using JT Apple Calendar to select a date to display in CalendarKit. The label will display the proper date, but the date selector above it, does not reflect the date that the label shows.
Is there an easy way to fix this? I've been told that it may be a bug.
The date scroll bar seems to take the current date, instead of the date that's been selected. I selected January 19th, 2017, but the date scroll bar shows December 2, 2017 which is today's date.
This is the package home for reference: https://github.com/richardtop/CalendarKit
Here is the relevant part of the code, where selectedDate is the date being displayed in the label and passed from JTAppleCalendar:
var selectedDate: Date! var selectedEvent: Event! var newEventDate: Date!
override func viewDidLoad() {
super.viewDidLoad()
dayView.autoScrollToFirstEvent = true
navigationController?.navigationBar.backgroundColor = .white
reloadData()
loadForSelectedDate(date: selectedDate)
}
func loadForSelectedDate(date: Date) {
dayView.state = DayViewState(date: date)
dayView.state?.move(to: date)
dayView.reloadData()
}