mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-09 06:55:47 +01:00
fix DateFromNow i18n without provided locales
This commit is contained in:
@@ -45,13 +45,18 @@ class DateFromNow extends React.Component<Props> {
|
|||||||
getLocale = (): Locale => {
|
getLocale = (): Locale => {
|
||||||
const { i18n } = this.props;
|
const { i18n } = this.props;
|
||||||
|
|
||||||
for (const lng of i18n.languages) {
|
for (const lng of i18n.languages || []) {
|
||||||
const locale = supportedLocales[lng];
|
const locale = supportedLocales[lng];
|
||||||
if (locale) {
|
if (locale) {
|
||||||
return locale;
|
return locale;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const locale = supportedLocales[i18n.language];
|
||||||
|
if (locale) {
|
||||||
|
return locale;
|
||||||
|
}
|
||||||
|
|
||||||
return enUS;
|
return enUS;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user