Skip to content

Commit 846ae35

Browse files
committed
Added two new properties: onOpenModal and onCloseModal
1 parent 59d414d commit 846ae35

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

index.js

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,11 +80,19 @@ class DatePicker extends Component {
8080

8181
onPressCancel() {
8282
this.setModalVisible(false);
83+
84+
if (typeof this.props.onCloseModal === 'function') {
85+
this.props.onCloseModal();
86+
}
8387
}
8488

8589
onPressConfirm() {
8690
this.datePicked();
8791
this.setModalVisible(false);
92+
93+
if (typeof this.props.onCloseModal === 'function') {
94+
this.props.onCloseModal();
95+
}
8896
}
8997

9098
getDate(date = this.props.date) {
@@ -228,6 +236,10 @@ class DatePicker extends Component {
228236
}).then(this.onDatetimePicked);
229237
}
230238
}
239+
240+
if (typeof this.props.onOpenModal === 'function') {
241+
this.props.onOpenModal();
242+
}
231243
}
232244

233245
render() {
@@ -361,6 +373,8 @@ DatePicker.propTypes = {
361373
showIcon: React.PropTypes.bool,
362374
disabled: React.PropTypes.bool,
363375
onDateChange: React.PropTypes.func,
376+
onOpenModal: React.PropTypes.func,
377+
onCloseModal: React.PropTypes.func,
364378
placeholder: React.PropTypes.string,
365379
modalOnResponderTerminationRequest: React.PropTypes.func,
366380
is24Hour: React.PropTypes.bool

0 commit comments

Comments
 (0)