Skip to content

Commit f5340e0

Browse files
Fine-tune the type narrowing
1 parent 4af4d0d commit f5340e0

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/components/date_picker/super_date_picker/date_popover/absolute_tab.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ export class EuiAbsoluteTab extends Component<
122122
let valueAsMoment = moment(
123123
textInputValue,
124124
dateFormat,
125-
typeof locale === 'string' ? locale : undefined,
125+
typeof locale === 'string' ? locale : 'en', // Narrow the union type to string
126126
true
127127
);
128128
let dateIsValid = valueAsMoment.isValid();

0 commit comments

Comments
 (0)