diff --git a/src/utils/date-time-format.js b/src/utils/date-time-format.js index ee6c0b6e..71d633e0 100644 --- a/src/utils/date-time-format.js +++ b/src/utils/date-time-format.js @@ -22,7 +22,7 @@ export function refreshLocales() { const createLocale = mem((language, options = {}) => { try { return new Intl.Locale(language, options); - } catch { + } catch (e) { // Fallback to simple string splitting // May not work properly due to how complicated this is if (!language) return null; @@ -77,7 +77,7 @@ const _DateTimeFormat = (locale, opts) => { try { return new Intl.DateTimeFormat(matchedLocale, options); - } catch { + } catch (e) { return new Intl.DateTimeFormat(undefined, options); } }; diff --git a/src/utils/dtf-locale.js b/src/utils/dtf-locale.js index c247bc6e..30d6d15f 100644 --- a/src/utils/dtf-locale.js +++ b/src/utils/dtf-locale.js @@ -10,7 +10,7 @@ function _getDtfLocale() { const dtfLocale = new Intl.DateTimeFormat().resolvedOptions().locale; store.session.set(DTFLOCALE_CACHE_KEY, dtfLocale); return dtfLocale; - } catch { + } catch (e) { return null; } }