Fix: Defaults / dayjs will not always be present.

This commit is contained in:
Paul
2021-07-04 12:46:33 +01:00
parent 504f491074
commit 78d0abb592

View File

@@ -127,7 +127,7 @@ function Locale({ children, locale }: Props) {
function transformLanguage(obj: { [key: string]: any }) { function transformLanguage(obj: { [key: string]: any }) {
const dayjs = obj.dayjs; const dayjs = obj.dayjs;
const defaults = dayjs.defaults; const defaults = dayjs?.defaults;
const twelvehour = defaults?.twelvehour === 'yes' || true; const twelvehour = defaults?.twelvehour === 'yes' || true;
const separator: '/' | '-' | '.' = defaults?.date_separator ?? '/'; const separator: '/' | '-' | '.' = defaults?.date_separator ?? '/';