Skip to content

Commit f07f7c1

Browse files
committed
1. Ios datepicker dialog ok, cancel button label config added to props.
1 parent f9a4b3b commit f07f7c1

File tree

3 files changed

+26
-3
lines changed

3 files changed

+26
-3
lines changed

README.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -222,9 +222,16 @@ AppRegistry.registerComponent('DatePickerTimePickerDialog', () => DatePickerTime
222222
**1. onDatePicked: PropTypes.func** - Date picked handler.
223223
`This method will be called when the user selected the date from picker.The first and only argument is a Date object representing the picked date and time.`
224224

225-
**2. onCancel: PropTypes.func** - Date Cancelled handler.
225+
**2. onCancel: PropTypes.func** - Date cancelled handler.
226226
`This method will be called when the user dismissed the picker.`
227227

228+
**3. okLabel: PropTypes.string** - `**Ios Only**` (Ok button label) .
229+
`Default value is 'Ok'`
230+
231+
**4. cancelLabel: PropTypes.string** - `**Ios Only**` (Cancel button label) .
232+
`Default value is 'Cancel'`
233+
234+
228235
# References
229236

230237
- https://facebook.github.io/react-native/docs/datepickerandroid.html

lib/datepicker/DatePickerDialog.ios.js

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,21 @@ export default class DatePickerDialog extends Component{
3939
* This is called when the user dismissed the picker.
4040
*/
4141
onCancel: PropTypes.func,
42+
43+
/**
44+
* Ok button label
45+
*/
46+
okLabel: PropTypes.string,
47+
48+
/**
49+
* Cancel button label
50+
*/
51+
cancelLabel: PropTypes.string
52+
}
53+
54+
static defaultProps = {
55+
okLabel: 'Ok',
56+
cancelLabel: 'Cancel'
4257
}
4358

4459
/**

package.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "react-native-datepicker-dialog",
3-
"version": "0.0.7",
3+
"version": "0.0.8",
44
"description": "This library provides the cross-platform components for to open the date picker dialogs in effective way. It uses the native DatePickerAndroid & DatePickerIOS components. It will work for both ios & android.",
55
"main": "main-index.js",
66
"scripts": {
@@ -43,6 +43,7 @@
4343
"jest": "17.0.3",
4444
"jest-react-native": "17.0.3",
4545
"react-test-renderer": "15.3.2",
46-
"moment": "2.x.x"
46+
"moment": "2.11.2",
47+
"prop-types": "^15.6.0"
4748
}
4849
}

0 commit comments

Comments
 (0)