diff --git a/src/relative-time-element.ts b/src/relative-time-element.ts index 2a4d26e..6f6d708 100644 --- a/src/relative-time-element.ts +++ b/src/relative-time-element.ts @@ -4,10 +4,10 @@ import {RelativeTimeFormat as RelativeTimeFormatPonyfill} from './relative-time- import {isDuration, withinDuration} from './duration.js' import {strftime} from './strftime.js' -const supportsIntlDatetime = 'Intl' in window && 'DateTimeFormat' +const supportsIntlDatetime = 'Intl' in window && 'DateTimeFormat' in Intl const DateTimeFormat = supportsIntlDatetime ? Intl.DateTimeFormat : DateTimeFormatPonyFill -const supportsIntlRelativeTime = 'Intl' in window && 'RelativeTimeFormat' +const supportsIntlRelativeTime = 'Intl' in window && 'RelativeTimeFormat' in Intl const RelativeTimeFormat = supportsIntlRelativeTime ? Intl.RelativeTimeFormat : RelativeTimeFormatPonyfill export type Format = 'auto' | 'micro' | string