jonathantribouharet / JTCalendar

A customizable calendar view for iOS.
MIT License
2.76k stars 531 forks source link

Not scrolling to today date. #384

Open NirajCapermint opened 4 years ago

NirajCapermint commented 4 years ago

I am using this library from the beginning and now I came across the issue that it doesn't scroll to today's date. It just stops to previous month's date. Anyone have this issue? Following code I have used.

`func setupJTCalendar() { self.dayCollectionView.cellSize = 60.0 self.dayCollectionView.minimumLineSpacing = 0 self.dayCollectionView.minimumInteritemSpacing = 0 self.dayCollectionView.scrollToDate(Date()) self.dayCollectionView.selectDates([Date()])

    self.dayCollectionView.visibleDates { (info) in
        if let data =  info.monthDates.first {
            self.dayCollectionView.scrollToItem(at: data.indexPath, at: .left, animated: true)
        }
    }
}`
NirajCapermint commented 4 years ago

Getting today's date: 2019-08-21 09:00:17 +0000 While indexPath and data are as follows: (date: 2019-07-31 18:30:00 +0000, indexPath: [0, 4])