@@ -80,11 +80,19 @@ class DatePicker extends Component {
80
80
81
81
onPressCancel ( ) {
82
82
this . setModalVisible ( false ) ;
83
+
84
+ if ( typeof this . props . onCloseModal === 'function' ) {
85
+ this . props . onCloseModal ( ) ;
86
+ }
83
87
}
84
88
85
89
onPressConfirm ( ) {
86
90
this . datePicked ( ) ;
87
91
this . setModalVisible ( false ) ;
92
+
93
+ if ( typeof this . props . onCloseModal === 'function' ) {
94
+ this . props . onCloseModal ( ) ;
95
+ }
88
96
}
89
97
90
98
getDate ( date = this . props . date ) {
@@ -228,6 +236,10 @@ class DatePicker extends Component {
228
236
} ) . then ( this . onDatetimePicked ) ;
229
237
}
230
238
}
239
+
240
+ if ( typeof this . props . onOpenModal === 'function' ) {
241
+ this . props . onOpenModal ( ) ;
242
+ }
231
243
}
232
244
233
245
render ( ) {
@@ -361,6 +373,8 @@ DatePicker.propTypes = {
361
373
showIcon : React . PropTypes . bool ,
362
374
disabled : React . PropTypes . bool ,
363
375
onDateChange : React . PropTypes . func ,
376
+ onOpenModal : React . PropTypes . func ,
377
+ onCloseModal : React . PropTypes . func ,
364
378
placeholder : React . PropTypes . string ,
365
379
modalOnResponderTerminationRequest : React . PropTypes . func ,
366
380
is24Hour : React . PropTypes . bool
0 commit comments