Skip to content
This repository was archived by the owner on Aug 7, 2025. It is now read-only.

Commit 192012e

Browse files
committed
fix(userLocales): check Intl is implemented before checking if DateTimeFormat is implemented
1 parent f07bd15 commit 192012e

File tree

1 file changed

+1
-1
lines changed
  • packages/preferred-locale/src/utils/userLocales

1 file changed

+1
-1
lines changed

packages/preferred-locale/src/utils/userLocales/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,6 @@
66
*/
77
export const userLocales = fallback => {
88
if (global?.navigator?.languages) return navigator.languages.concat([ fallback ])
9-
if ('DateTimeFormat' in Intl) return [ Intl.DateTimeFormat().resolvedOptions().locale, fallback ]
9+
if (Intl && 'DateTimeFormat' in Intl) return [ Intl.DateTimeFormat().resolvedOptions().locale, fallback ]
1010
return [ fallback ]
1111
}

0 commit comments

Comments
 (0)