FSCalendar How To Understand If User Scrolled the Calendar Page

835 Views Asked by At

I hid the fscalendar header (previous, current and next date texts) and added two buttons (next and previous month) and label which shows month name of current fscalendar page. I'm trying to change month name label's text when user scrolled the page. I have min and max dates, I want to stop scrolling when user reaches those pages. How may I do that?

Thanks

1

There are 1 best solutions below

0
Shabnam Siddiqui On BEST ANSWER
calendarCurrentPageDidChange(yourfsCalender)

To get Month Name

func calendarCurrentPageDidChange(_ calendar: FSCalendar) {
    let currentPageDate = calendar.currentPage
    let month = Calendar.current.component(.month, from: currentPageDate)
    let monthName = DateFormatter().monthSymbols[month - 1].capitalized
    print(monthName)
    lblMonth.text = monthName   
}