Skip to content

Commit

Permalink
refactor: simplify to use an array for the week day names map
Browse files Browse the repository at this point in the history
  • Loading branch information
mgadewoll committed May 14, 2024
1 parent 916a08d commit 5ca6ff7
Showing 1 changed file with 8 additions and 22 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -64,27 +64,13 @@ import {
} from "./date_utils";

const WEEK_DAY_NAMES = [
{
default: 'Sunday',
},
{
default: 'Monday',
},
{
default: 'Tuesday',
},
{
default: 'Wednesday',
},
{
default: 'Thursday',
},
{
default: 'Friday',
},
{
default: 'Saturday',
},
'Sunday',
'Monday',
'Tuesday',
'Wednesday',
'Thursday',
'Friday',
'Saturday',
];

const FocusTrapContainer = React.forwardRef((props, ref) => <div ref={ref} className="react-datepicker__focusTrap" {...props}/>);
Expand Down Expand Up @@ -400,7 +386,7 @@ export default class Calendar extends React.Component {
{isLocaleEnglish && (
<EuiScreenReaderOnly>
<span>
{WEEK_DAY_NAMES[currentDayIndex].default}
{WEEK_DAY_NAMES[currentDayIndex]}
</span>
</EuiScreenReaderOnly>
)}
Expand Down

0 comments on commit 5ca6ff7

Please sign in to comment.