AVCalendar icon indicating copy to clipboard operation
AVCalendar copied to clipboard

Set maximum date lesser than current date

Open abhinav2014 opened this issue 4 years ago • 2 comments

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.

abhinav2014 avatar May 11 '20 15:05 abhinav2014

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 avatar Jun 10 '20 07:06 vyasanirudh

@vyasanirudh I'll check that as i get time from work. Thanks for responding.

abhinav2014 avatar Jun 16 '20 09:06 abhinav2014