Skip to content
This repository has been archived by the owner on Jun 16, 2022. It is now read-only.

Commit

Permalink
add locale try catch
Browse files Browse the repository at this point in the history
  • Loading branch information
ggilchrist-ledger committed Apr 28, 2022
1 parent ae85cd1 commit 13bcadd
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
1 change: 1 addition & 0 deletions .github/workflows/detox-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,7 @@ jobs:
adb logcat *:E &
$ANDROID_HOME/platform-tools/adb devices
adb shell getprop persist.sys.timezone
adb shell setprop persist.sys.timezone "Europe/Paris"
yarn e2e:test -c android.staging e2e/specs/onboarding.spec.js --loglevel trace --record-logs failing --record-timeline all --take-screenshots failing
# yarn start & yarn detox test -c android.debug --loglevel verbose --record-logs failing --record-timeline all --take-screenshots failing
# mkdir ./temp
Expand Down
12 changes: 8 additions & 4 deletions src/context/Locale.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,14 @@ import {
} from "../languages";
import { languageSelector } from "../reducers/settings";

if ("__setDefaultTimeZone" in Intl.DateTimeFormat) {
/** https://formatjs.io/docs/polyfills/intl-datetimeformat/#default-timezone */
// $FlowFixMe
Intl.DateTimeFormat.__setDefaultTimeZone(getTimeZone()); // eslint-disable-line no-underscore-dangle
try {
if ("__setDefaultTimeZone" in Intl.DateTimeFormat) {
/** https://formatjs.io/docs/polyfills/intl-datetimeformat/#default-timezone */
// $FlowFixMe
Intl.DateTimeFormat.__setDefaultTimeZone(getTimeZone()); // eslint-disable-line no-underscore-dangle
}
} catch (error) {
console.log(error);
}

i18next.use(initReactI18next).init({
Expand Down

0 comments on commit 13bcadd

Please sign in to comment.