Skip to content

Commit

Permalink
Merge pull request #201 from github/fix-bug-in-intl-detection
Browse files Browse the repository at this point in the history
fix bug in Intl detection
  • Loading branch information
keithamus authored Nov 7, 2022
2 parents 05a3e8b + d826f82 commit 1be3d31
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/relative-time-element.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 1be3d31

Please sign in to comment.