Skip to content

Intl.DateTimeFormat.formatRange polyfill doesn't match web reality #2915

Open
@longlho

Description

@longlho
const date1 = new Date(Date.UTC(2021, 4, 19, 9, 0)) // "May 19, 2021, 9 AM"
const date2 = new Date(Date.UTC(2021, 5, 19, 17, 0)) // "Jun 19, 2021, 5 PM"
const dtf = new DateTimeFormat('en', {
  hour: 'numeric',
  minute: 'numeric',
  timeZone: 'America/New_York',
})
dtf.formatRange(date1, date2) // Should return 5/19/2021, 5:00 AM – 6/19/2021, 1:00 PM but right now returning 5:00 AM - 1:00 PM

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions