Skip to content

Commit

Permalink
fix: Change default header text for time on iOS (#560)
Browse files Browse the repository at this point in the history
  • Loading branch information
justinsdre authored May 8, 2021
1 parent cba1468 commit 2435f38
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/DateTimePickerModal.ios.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ export class DateTimePickerModal extends React.PureComponent {
static defaultProps = {
cancelTextIOS: "Cancel",
confirmTextIOS: "Confirm",
headerTextIOS: "Pick a date",
modalPropsIOS: {},
date: new Date(),
isDarkModeEnabled: undefined,
Expand Down Expand Up @@ -135,6 +134,11 @@ export class DateTimePickerModal extends React.PureComponent {
? pickerStyles.containerDark
: pickerStyles.containerLight;

const headerText =
headerTextIOS || this.props.mode === "time"
? "Pick a time"
: "Pick a date";

return (
<Modal
isVisible={isVisible}
Expand All @@ -150,7 +154,7 @@ export class DateTimePickerModal extends React.PureComponent {
pickerContainerStyleIOS,
]}
>
<HeaderComponent label={headerTextIOS} />
<HeaderComponent label={headerText} />
<PickerComponent
display="spinner"
{...otherProps}
Expand Down

0 comments on commit 2435f38

Please sign in to comment.