JZDatepicker
JZDatepicker copied to clipboard
selectDate at index throws error
I want to load the calendar with 14 days(one week to the past and one week to the future) and I'm using the below code to do it. This works fine, but when the current date is the month beginning I'm getting crash with the below error.
Attempted to scroll the collection view to an out-of-bounds item (7) when there are only 7 items in section 0
var prevDate = Date()
prevDate.changeDays(by: -7)
datePicker.fillDates(from: prevDate, numberOfDays: 14)
datePicker.selectDate(at: 7)