Skip to content

Commit e4ede2a

Browse files
authored
Merge pull request #10 from geekvijay/master
minDateAndroid and maxDateAndroid converted minimumDate and maximumDate
2 parents 35fa95b + fe1598b commit e4ede2a

File tree

2 files changed

+8
-9
lines changed

2 files changed

+8
-9
lines changed

README.md

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -70,15 +70,14 @@ 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
73+
| minimumDate | Date | undefined | Min Date
74+
| maximumDate | Date | undefined | Max Date
7575

7676
All the [DatePickerIOS props](https://facebook.github.io/react-native/docs/datepickerios.html) are also supported!
7777

7878
## Notes
79-
Just remember to always set the `isVisible` prop to `false` in both `onConfirm` and `onCancel` (like in the example above).
79+
Just remember to always set the `isVisible` prop to `false` in both `onConfirm` and `onCancel` (like in the example above).
8080

8181
Under the hood this library is using [react-native-animated-modal](https://github.com/mmazzarolo/react-native-animated-modal) for the iOS modal implementation.
8282

83-
Pull request and suggestions are welcome!
84-
83+
Pull request and suggestions are welcome!

src/CustomDatePickerAndroid/index.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ export default class CustomDatePickerAndroid extends Component {
99
onCancel: PropTypes.func.isRequired,
1010
onConfirm: PropTypes.func.isRequired,
1111
isVisible: PropTypes.bool,
12-
minDateAndroid: PropTypes.instanceOf(Date),
13-
maxDateAndroid: PropTypes.instanceOf(Date)
12+
minimumDate: PropTypes.instanceOf(Date),
13+
maximumDate: PropTypes.instanceOf(Date)
1414
}
1515

1616
static defaultProps = {
@@ -33,8 +33,8 @@ export default class CustomDatePickerAndroid extends Component {
3333
try {
3434
const { action, year, month, day } = await DatePickerAndroid.open({
3535
date: this.props.date,
36-
minDate: this.props.minDateAndroid,
37-
maxDate: this.props.maxDateAndroid
36+
minDate: this.props.minimumDate,
37+
maxDate: this.props.maximumDate
3838
})
3939
if (action !== DatePickerAndroid.dismissedAction) {
4040
const date = moment({ year, month, day }).toDate()

0 commit comments

Comments
 (0)