Open bufke opened 7 years ago
This is happening on iOS as well and it also happens when you set your minDate to 1920
it defaults to 2020
@bufke
If you haven't found a solution. I was looking through their code and found this https://github.com/xgfe/react-native-datepicker/blob/master/index.js#L152
this worked for me:
<DatePicker minDate={'1920-01-01'} maxDate={'2017-01-01'} format={'YYYY-MM-DD'} />
@jnrepo This didn't work for me, tried setting the minDate to 1900-01-01 but it actually sets the minDate to 2000-01-01
@jnrepo's solution seemed to work for me. There was one caveat:
For the maxDate, I was using a JS Date object and it worked fine. For minDate, I was using a text string. When I changed the date format, I had to make sure that the minDate string followed my format specification for it to work.
any solution?
Tested on Android.
androidMode="spinner"
(It's very hard to pick older dates without the spinner)The date now shows as 2065 instead of 1965. The problem is purely visual however. When I inspect
onDateChange
I see the 1965 date selected. I am unsure if the behavior is reproducible in ios or not.