From 3bf63fbe46c1d6a799388fdff62f87d1eed8106d Mon Sep 17 00:00:00 2001 From: Cody Nguyen Date: Tue, 26 May 2020 16:08:58 +0700 Subject: [PATCH 1/2] allow passing in a custom DatePickerIOSComponent --- datepicker.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/datepicker.js b/datepicker.js index ac6cacde29..e5d8b55179 100644 --- a/datepicker.js +++ b/datepicker.js @@ -341,9 +341,12 @@ class DatePicker extends Component { cancelBtnTestID, confirmBtnTestID, allowFontScaling, - locale + locale, + textColor, } = this.props; + const DatePickerIOSComponent = this.props.iOSDatePickerComponent || DatePickerIOS; + const dateInputStyle = [ Style.dateInput, customStyles.dateInput, disabled && Style.disabled, @@ -391,12 +394,15 @@ class DatePicker extends Component { style={[Style.datePickerCon, {height: this.state.animatedHeight}, customStyles.datePickerCon]} > - Date: Thu, 27 Aug 2020 10:21:51 +0700 Subject: [PATCH 2/2] fix onChange returning date as the 2nd arg --- datepicker.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/datepicker.js b/datepicker.js index e5d8b55179..2db3eb062f 100644 --- a/datepicker.js +++ b/datepicker.js @@ -402,7 +402,7 @@ class DatePicker extends Component { minimumDate={minDate && this.getDate(minDate)} maximumDate={maxDate && this.getDate(maxDate)} onDateChange={this.onDateChange} - onChange={this.onDateChange} + onChange={(e, date) => this.onDateChange(date)} minuteInterval={minuteInterval} timeZoneOffsetInMinutes={timeZoneOffsetInMinutes ? timeZoneOffsetInMinutes : null} style={[Style.datePicker, customStyles.datePicker]}