maxDate is not working on ios
See original GitHub issueIssue
When i’m using react-native-datepicker, maxDate properties working correctly in android but is not working on ios.
Code
<DatePicker
style={{
width: api.getRealDeviceWidth() * 0.9
}}
date={this.state.dob}
mode="date"
placeholder="select date"
format="YYYY-MM-DD"
minDate={'1960-01-01'}
maxDate={'1995-01-01'}
confirmBtnText="Confirm"
cancelBtnText="Cancel"
showIcon={false}
customStyles={{
dateInput: {
borderColor: '#cdcdcd',
borderRadius: 2,
height: 36
},
dateText: {
textAlign: 'left',
width: api.getRealDeviceWidth() * 0.9,
padding: 12
}
}}
onDateChange={(date) => {
this.setState({dob: date})
}}/>
Environment
react-native -v
: 0.40.0target platform
: iOSoperating system
: Linux
Issue Analytics
- State:
- Created 6 years ago
- Reactions:2
- Comments:8
Top Results From Across the Web
minDate & maxDate not working on iOS? · Issue #16 - GitHub
I'm trying to use minDate and maxDate but doesn't seem to work on iOS. This is how my Picker looks: <DatePicker onDateChange={this.
Read more >Mobile IOS input type date min and max not working on ...
It appears that this has already been asked here: Html 5 [input type=Date] control, MAX date is not working in iPhone/Ipad.
Read more >Html 5 [input type=Date] control, MAX date is not working in ...
HTML : Html 5 [input type=Date] control, MAX date is not working in iPhone / Ipad [ Gift : Animated Search Engine :...
Read more >react-native-community/datetimepicker - npm
React Native date & time picker component for iOS, Android and Windows ... Other configurations are very likely to work as well but...
Read more >[Solved]-Maxdate not updating after app went in background for a ...
Related Query · Updating locations while app in background working on simulator but not on device (iOS 9) · guaranteed delivery for uploads...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
keeping format of minDate and maxDate same as format of DatePicker, solved the problem for me.
@kamranyounis12 is right, the dates are compared via simple
<
and>
comparison so you need to supply the dates in identical/comparable formats. I’m passing a native JSnew Date()
to each.