diff --git a/CHANGELOG.md b/CHANGELOG.md index 0fdaed03d03..a11155fc62c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,7 @@ - Fixed `EuiCode` and `EuiCodeBlock` from erroring in environments without a DOM implementation ([#3405](https://github.com/elastic/eui/pull/3405)) - Fixed `ApplyClassComponentDefaults` typescript utility to correctly determine defaulted properties' types ([#3430](https://github.com/elastic/eui/pull/3430)) +- Fixed `prettyDuration` return type to be `string`, use fallback value ([#3438](https://github.com/elastic/eui/pull/3438)) ## [`23.2.0`](https://github.com/elastic/eui/tree/v23.2.0) diff --git a/src/components/date_picker/super_date_picker/pretty_duration.ts b/src/components/date_picker/super_date_picker/pretty_duration.ts index 8436373ac4f..86d565d22f8 100644 --- a/src/components/date_picker/super_date_picker/pretty_duration.ts +++ b/src/components/date_picker/super_date_picker/pretty_duration.ts @@ -87,7 +87,7 @@ export function prettyDuration( return timeFrom === quickFrom && timeTo === quickTo; } ); - if (matchingQuickRange) { + if (matchingQuickRange && matchingQuickRange.label) { return matchingQuickRange.label; }