Skip to content

Commit

Permalink
fix: improved code readability
Browse files Browse the repository at this point in the history
  • Loading branch information
Henrik Kubitza committed Sep 19, 2024
1 parent 017183d commit 342d370
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/time.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,11 @@ export default class Time extends Component<TimeProps, TimeState> {
};

renderTimeCaption = (): JSX.Element => {
return (this.props.showTimeCaption ?? Time.defaultProps.showTimeCaption) ? (
if (this.props.showTimeCaption === false) {
return <></>;
}

return (
<div
className={`react-datepicker__header react-datepicker__header--time ${
this.props.showTimeSelectOnly
Expand All @@ -268,8 +272,6 @@ export default class Time extends Component<TimeProps, TimeState> {
{this.props.timeCaption}
</div>
</div>
) : (
<></>
);
};

Expand Down

0 comments on commit 342d370

Please # to comment.