From 8e0e226ec6f9bcb6bcdb6a49751dcd4df411b4c1 Mon Sep 17 00:00:00 2001
From: Paul <paulmakles@gmail.com>
Date: Sun, 4 Jul 2021 12:46:33 +0100
Subject: [PATCH] Fix: Defaults / dayjs will not always be present.

---
 src/context/Locale.tsx | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/context/Locale.tsx b/src/context/Locale.tsx
index 0385745..ea75394 100644
--- a/src/context/Locale.tsx
+++ b/src/context/Locale.tsx
@@ -127,7 +127,7 @@ function Locale({ children, locale }: Props) {
 
     function transformLanguage(obj: { [key: string]: any }) {
         const dayjs = obj.dayjs;
-        const defaults = dayjs.defaults;
+        const defaults = dayjs?.defaults;
 
         const twelvehour = defaults?.twelvehour === 'yes' || true;
         const separator: '/' | '-' | '.' = defaults?.date_separator ?? '/';
-- 
GitLab