Fscalendar: selectDate:scrollToDate: is not working

Created on 24 Jan 2018  路  2Comments  路  Source: WenchaoD/FSCalendar

  • A brief bug description.
    Scroll to a specific date and setting header background colors are not working if Pagination set to false.
    I even tried with DIYExampleViewController in FSCalendar examples. Observed the same behaviour. Please let me is it a bug or I am missing something.

  • Integration method.
    cocoapods

  • Full steps to reproduce.
    calendar.pagingEnabled = false;
    calendar.calendarHeaderView.backgroundColor = [UIColor brownColor] ;
    [self.calendar selectDate:[self.dateFormatter dateFromString:@"2017-09-02"] scrollToDate:YES];

  • Device modal and iOS version.
    Any device / simulator

  • Xcode version.
    9.2

  • FSCalendar version.
    2.7.9

  • Does this happen in the demo project? Which one? Or a link to another demo project.
    Yes. DIYExampleViewController or Any other.

Most helpful comment

I found the work around by setting paging enabled true before calling selectDate:scrollToDate: and then setting paging enabled to false.

All 2 comments

I found the work around by setting paging enabled true before calling selectDate:scrollToDate: and then setting paging enabled to false.

let indexPath = calendarView.calculator.indexPath(for: date)!
calendarView.collectionView.scrollToItem(at: indexPath, at: .centeredVertically, animated: false)

Was this page helpful?
0 / 5 - 0 ratings

Related issues

GDXRepo picture GDXRepo  路  3Comments

divya417 picture divya417  路  6Comments

rintoandrews90 picture rintoandrews90  路  4Comments

KushThakkar picture KushThakkar  路  6Comments

StanleySathler picture StanleySathler  路  5Comments