MCPcopy Index your code
hub / github.com/formatjs/formatjs / supportsDateStyle

Function supportsDateStyle

packages/intl-datetimeformat/should-polyfill.ts:4–14  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

2import {supportedLocales} from '@formatjs_generated/cldr.supported-locales/intl-datetimeformat.js'
3
4function supportsDateStyle() {
5 try {
6 return !!(
7 new Intl.DateTimeFormat(undefined, {
8 dateStyle: 'short',
9 } as any).resolvedOptions() as any
10 ).dateStyle
11 } catch {
12 return false
13 }
14}
15
16/**
17 * https://bugs.chromium.org/p/chromium/issues/detail?id=865351

Callers 1

shouldPolyfillFunction · 0.85

Calls 1

resolvedOptionsMethod · 0.65

Tested by

no test coverage detected