diff --git a/README.md b/README.md index d535d7e..d28e601 100644 --- a/README.md +++ b/README.md @@ -118,7 +118,6 @@ in [RNPlayground](https://github.com/react-component/RNPlayground) |date | The currently selected date. | moment | | |visible | whether pop picker is visible | Boolean | false | |onChange | exec on ok | Function(date: moment) | | -|onPickerChange | Date inside picker change handler. | Function(date: moment) | '' | |onVisibleChange | called when pop picker visible change | Function | | |onDismiss | exec on dismiss | function | | |okText | ok button text | String | 'Ok' | diff --git a/examples/popup.tsx b/examples/popup.tsx index 08c5cfe..747e274 100644 --- a/examples/popup.tsx +++ b/examples/popup.tsx @@ -54,6 +54,11 @@ class Demo extends React.Component { date, }); }; + + onPickerChange(date) { + console.log('onPickerChange', format(date)); + } + onDismiss = () => { console.log('onDismiss'); }; @@ -72,6 +77,7 @@ class Demo extends React.Component { maxDate={maxDate} defaultDate={now} mode={props.mode} + onDateChange={this.onPickerChange} locale={props.locale} /> ); diff --git a/examples/react-native/popup.tsx b/examples/react-native/popup.tsx index 8e14ad6..0af3942 100644 --- a/examples/react-native/popup.tsx +++ b/examples/react-native/popup.tsx @@ -59,12 +59,11 @@ class Demo extends React.Component { date, }); }; + onDismiss = () => { console.log('onDismiss'); }; - onPickerChange = (date) => { - console.log('onPickerChange', format(date)); - }; + show = () => { console.log('my click'); }; @@ -91,7 +90,6 @@ class Demo extends React.Component { styles={PopupStyles} title="Date picker" date={date} - onPickerChange={this.onPickerChange} onDismiss={this.onDismiss} onChange={this.onChange} > diff --git a/package.json b/package.json index e7f3d96..1a7b4c2 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "rmc-date-picker", - "version": "5.0.0", + "version": "5.0.1", "description": "React Mobile DatePicker Component for web and react-native", "keywords": [ "react", diff --git a/src/Popup.tsx b/src/Popup.tsx index e79b751..85f60fc 100644 --- a/src/Popup.tsx +++ b/src/Popup.tsx @@ -44,7 +44,9 @@ export default class PopupDatePicker extends React.Component { @@ -66,14 +68,6 @@ export default class PopupDatePicker extends React.Component { if (this.state.visible !== visible) { if (!('visible' in this.props)) { @@ -84,11 +78,17 @@ export default class PopupDatePicker extends React.Component); }