Hi there!
I like you library, and hoping to use it my app, but before I do I just want to know if the following is possible... (I tried to figure it out, but couldnt :( )
Is it possible to set a minimum and maximum date for the calendar selection? For instance I dont want users to select anything in the future, and how many days in the past would have to be configurable based on the context.
I see there is a 'minimumDate' and 'maximumDate' properties, but seem to be readOnly.
Any idea if the above request is possible?
Thanks again!
my bad! just saw it was there in the Swift project. :) thanks!
User this
// FSCalendarDataSource
same for maximum.
fileprivate lazy var dateFormatter: DateFormatter = {
let formatter = DateFormatter()
formatter.dateFormat = "yyyy-MM-dd"
return formatter
}()
func minimumDate(for calendar: FSCalendar) -> Date {
return self.dateFormatter.date(from: "2018-01-01")!
}
func maximumDate(for calendar: FSCalendar) -> Date {
return self.dateFormatter.date(from: "2018-02-28")!
}
These two methods are not getting called. Delegate is not nil. All other delegates methods are getting called.
What I was trying is... I want calendar to start with today's date so that user would not select past dates and only show 3 months from today.
For this I have to use these two methods only but they are not getting called.
func minimumDate(for calendar: FSCalendar) -> Date {
return Date()
}
@idevChandra6
Hi, use FSCalendarDatasource instead of FSCalendarDelegate
Best regards.
refs #870
Most helpful comment