diff --git a/src/common/dates/index.ts b/src/common/dates/index.ts index 299487fbd..bd05f7816 100644 --- a/src/common/dates/index.ts +++ b/src/common/dates/index.ts @@ -3,7 +3,7 @@ import localeInfo, { LocaleInfo, Locales } from "./locale-info"; export function localeDefault(locale?: string) { if (locale) return locale; - if (typeof navigator !== "undefined") return navigator.language; + if (typeof navigator !== "undefined" && navigator.language) return navigator.language; return "en-US"; } diff --git a/src/components/ebay-phone-input/component.ts b/src/components/ebay-phone-input/component.ts index aaba8dd96..29ba5b85e 100644 --- a/src/components/ebay-phone-input/component.ts +++ b/src/components/ebay-phone-input/component.ts @@ -60,6 +60,7 @@ class PhoneInput extends Marko.Component { onInput(input: Input) { const { countryCode } = input; let locale = localeDefault(input.locale); + console.log(input.locale, locale); if (locale !== this.locale) { this.locale = locale; const getName = new Intl.DisplayNames([locale], { type: "region" });