File tree Expand file tree Collapse file tree 2 files changed +8
-2
lines changed
src/CustomDatePickerAndroid Expand file tree Collapse file tree 2 files changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -70,6 +70,8 @@ export default class DateTimePickerTester extends Component {
7070| onConfirm | func | ** REQUIRED** | Function called on date picked |
7171| onCancel | func | ** REQUIRED** | Function called on dismiss |
7272| titleIOS | string | 'Pick a date' | The title text on iOS |
73+ | minDateAndroid | Date | undefined | Min Date
74+ | maxDateAndroid | Date | undefined | Max Date
7375
7476All the [ DatePickerIOS props] ( https://facebook.github.io/react-native/docs/datepickerios.html ) are also supported!
7577
Original file line number Diff line number Diff line change @@ -8,7 +8,9 @@ export default class CustomDatePickerAndroid extends Component {
88 mode : PropTypes . oneOf ( [ 'date' , 'time' , 'datetime' ] ) ,
99 onCancel : PropTypes . func . isRequired ,
1010 onConfirm : PropTypes . func . isRequired ,
11- isVisible : PropTypes . bool
11+ isVisible : PropTypes . bool ,
12+ minDateAndroid : PropTypes . instanceOf ( Date ) ,
13+ maxDateAndroid : PropTypes . instanceOf ( Date )
1214 }
1315
1416 static defaultProps = {
@@ -30,7 +32,9 @@ export default class CustomDatePickerAndroid extends Component {
3032 _showDatePickerAndroid = async ( ) => {
3133 try {
3234 const { action, year, month, day } = await DatePickerAndroid . open ( {
33- date : this . props . date
35+ date : this . props . date ,
36+ minDate : this . props . minDateAndroid ,
37+ maxDate : this . props . maxDateAndroid
3438 } )
3539 if ( action !== DatePickerAndroid . dismissedAction ) {
3640 const date = moment ( { year, month, day } ) . toDate ( )
You can’t perform that action at this time.
0 commit comments