Skip to content

Commit

Permalink
allow passing in a custom DatePickerIOSComponent
Browse files Browse the repository at this point in the history
  • Loading branch information
codynguyen committed May 26, 2020
1 parent 2a209bd commit a0d9d9b
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions datepicker.js
Original file line number Diff line number Diff line change
Expand Up @@ -341,9 +341,12 @@ class DatePicker extends Component {
cancelBtnTestID,
confirmBtnTestID,
allowFontScaling,
locale
locale,
textColor,
} = this.props;

const DatePickerIOSComponent = this.props.DatePickerIOSComponent || DatePickerIOS;

const dateInputStyle = [
Style.dateInput, customStyles.dateInput,
disabled && Style.disabled,
Expand Down Expand Up @@ -391,12 +394,15 @@ class DatePicker extends Component {
style={[Style.datePickerCon, {height: this.state.animatedHeight}, customStyles.datePickerCon]}
>
<View pointerEvents={this.state.allowPointerEvents ? 'auto' : 'none'}>
<DatePickerIOS
<DatePickerIOSComponent
date={this.state.date}
value={this.state.date}
textColor={textColor}
mode={mode}
minimumDate={minDate && this.getDate(minDate)}
maximumDate={maxDate && this.getDate(maxDate)}
onDateChange={this.onDateChange}
onChange={this.onDateChange}
minuteInterval={minuteInterval}
timeZoneOffsetInMinutes={timeZoneOffsetInMinutes ? timeZoneOffsetInMinutes : null}
style={[Style.datePicker, customStyles.datePicker]}
Expand Down

0 comments on commit a0d9d9b

Please sign in to comment.