Search code examples
iosswiftfscalendar

FSCalendar (Swift 4) how to start the week on a particular date


I'm using FSCalendar and need the week view to always begin at today and then show a week's worth.

Anyone know how to do this?

Thanks.


Solution

  • You can change the first week day of the calendar.

    override func viewDidLoad() {
        self.calendar.firstWeekday = 3
    }
    

    set 1 for sunday, 2 for monday and so on...

    more information at: http://cocoadocs.org/docsets/FSCalendar/2.7.9/Classes/FSCalendar.html#//api/name/firstWeekday