diff --git a/README.md b/README.md index 2696a4c080..fa0d9f2b37 100644 --- a/README.md +++ b/README.md @@ -39,12 +39,13 @@ You can check [index.js](https://github.com/xgfe/react-native-datepicker/blob/ma | date | - | `string | date` | Specify the display date of DatePicker. `string` type value must match the specified format | | mode | 'date' | `enum` | The `enum` of `date`, `datetime` and `time` | | format | 'YYYY-MM-DD' | `string` | Specify the display format of the date, which using [moment.js](http://momentjs.com/). The default value change according to the mode. | -| confirmBtnText | - | `string` | Specify the text of confirm btn in ios. | -| cancelBtnText | - | `string` | Specify the text of cancel btn in ios. | +| confirmBtnText | '确定' | `string` | Specify the text of confirm btn in ios. | +| cancelBtnText | '取消' | `string` | Specify the text of cancel btn in ios. | | iconSource | - | `{uri: string} | number` | Specify the icon. Same as the `source` of Image, always using `require()` | | minDate | - | `string | date` | Restricts the range of possible date values. | | maxDate | - | `string | date` | Restricts the range of possible date values. | -| duration | 300 | `number` | Specify the animation duration of datepicker. +| duration | 300 | `number` | Specify the animation duration of datepicker.| +| customStyles | - | `number` | The hook of customize datepicker style, same as the native style. `dateTouchBody`, `dateInput`...| ## Methods diff --git a/index.js b/index.js index bce4847076..353d81e6dd 100644 --- a/index.js +++ b/index.js @@ -45,6 +45,7 @@ class DatePicker extends Component { cancelBtnText = this.props.cancelBtnText || '取消'; iconSource = this.props.iconSource || require('./date_icon.png'); + customStyles = this.props.customStyles || {}; state = { date: this.getDate(), @@ -201,12 +202,12 @@ class DatePicker extends Component { underlayColor={'transparent'} onPress={this.onPressDate} > - - - {this.getDateStr()} + + + {this.getDateStr()} {Platform.OS === 'ios' && - + this.setState({date: date})} - style={Style.datePicker} + style={[Style.datePicker, this.customStyles.datePicker]} /> - {this.cancelBtnText} + {this.cancelBtnText} - {this.confirmBtnText} + {this.confirmBtnText} diff --git a/package.json b/package.json index 45b8f48006..dbfc9d49fb 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "react-native-datepicker", - "version": "1.0.3", + "version": "1.1.0", "description": "react native datePicker component for both Android and IOS, useing DatePikcerAndroid, TimePickerAndroid and DatePickerIOS", "main": "index.js", "scripts": {