diff --git a/scm-ui/ui-components/src/DateFromNow.tsx b/scm-ui/ui-components/src/DateFromNow.tsx index 5ed175ee92..1803b43461 100644 --- a/scm-ui/ui-components/src/DateFromNow.tsx +++ b/scm-ui/ui-components/src/DateFromNow.tsx @@ -45,13 +45,18 @@ class DateFromNow extends React.Component { getLocale = (): Locale => { const { i18n } = this.props; - for (const lng of i18n.languages) { + for (const lng of i18n.languages || []) { const locale = supportedLocales[lng]; if (locale) { return locale; } } + const locale = supportedLocales[i18n.language]; + if (locale) { + return locale; + } + return enUS; };