Skip to content

Commit 3bf63fb

Browse files
committed
allow passing in a custom DatePickerIOSComponent
1 parent 2a209bd commit 3bf63fb

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

datepicker.js

+8-2
Original file line numberDiff line numberDiff line change
@@ -341,9 +341,12 @@ class DatePicker extends Component {
341341
cancelBtnTestID,
342342
confirmBtnTestID,
343343
allowFontScaling,
344-
locale
344+
locale,
345+
textColor,
345346
} = this.props;
346347

348+
const DatePickerIOSComponent = this.props.iOSDatePickerComponent || DatePickerIOS;
349+
347350
const dateInputStyle = [
348351
Style.dateInput, customStyles.dateInput,
349352
disabled && Style.disabled,
@@ -391,12 +394,15 @@ class DatePicker extends Component {
391394
style={[Style.datePickerCon, {height: this.state.animatedHeight}, customStyles.datePickerCon]}
392395
>
393396
<View pointerEvents={this.state.allowPointerEvents ? 'auto' : 'none'}>
394-
<DatePickerIOS
397+
<DatePickerIOSComponent
395398
date={this.state.date}
399+
value={this.state.date}
400+
textColor={textColor}
396401
mode={mode}
397402
minimumDate={minDate && this.getDate(minDate)}
398403
maximumDate={maxDate && this.getDate(maxDate)}
399404
onDateChange={this.onDateChange}
405+
onChange={this.onDateChange}
400406
minuteInterval={minuteInterval}
401407
timeZoneOffsetInMinutes={timeZoneOffsetInMinutes ? timeZoneOffsetInMinutes : null}
402408
style={[Style.datePicker, customStyles.datePicker]}

0 commit comments

Comments
 (0)