All we have to do is pass the minimum and maximum year inside firstDate and lastDate properties and the Date picker will show us all the years between them. We have to use Future keyword with date picker, This method will get us the current selected date on Alert dialog closure event and returns us the date.