AVCalendar
AVCalendar copied to clipboard
Set maximum date lesser than current date
I want to select date of birth of user for which minimum age is 16, so it becomes 1922 to 2004
How can i do that.
Hi @abhinav2014, this might be too late for you. (I wasn't getting the mail notifications for some odd reason)
In order to achieve this you replace:
Under the file: AVCustomCalendarController
, update the struct: CalendarComponents
like this:
let years = (((Calendar.current.component(.year, from: Date()) - AGE_LIMIT)-100)...(Calendar.current.component(.year, from: Date()) - AGE_LIMIT)).map { String($0) }
Set the age limit you wish to set. Let me know for any other help! Cheers!
@vyasanirudh I'll check that as i get time from work. Thanks for responding.