From d826f82f4e9417b391624a77a91a00744197e13c Mon Sep 17 00:00:00 2001 From: Keith Cirkel Date: Mon, 7 Nov 2022 18:38:49 +0000 Subject: [PATCH] fix bug in Intl detection --- src/relative-time-element.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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