Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test more ways of calling formatInTimeZone() #187

Merged
merged 1 commit into from Jul 9, 2022
Merged

test more ways of calling formatInTimeZone() #187

merged 1 commit into from Jul 9, 2022

Conversation

patrik-csak
Copy link
Contributor

No description provided.

@marnusw
Copy link
Owner

marnusw commented Jul 9, 2022

I see the issue now. This breaks when passing the offset to Intl.DTF which expects an IANA time zone name: In src/_lib/tzIntlTimeZoneName/index.js#30

return new Intl.DateTimeFormat(locale ? [locale.code, 'en-US'] : undefined, {
    timeZone: timeZone,
    timeZoneName: length,
  })

I'll have to think about it, but I don't see how one could get the tz name from an offset. Furthermore, one couldn't really say what the expected name would be when there are multiple time zone names per offset. That may well be why DTF doesn't support it. I will change the documentation to reflect this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants