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

Continuing: use Intl API for guessing when available #304

Merged
merged 8 commits into from
Mar 1, 2016

Conversation

timrwood
Copy link
Member

Continuing work on #291.

Since the ECMA-402 Internationalization API provides a mechanism to get the current time zone, we should use it when available and fully implemented.

All of the dot accessors in Intl.DateTimeFormat().resolvedOptions().timeZone were worrying me, especially with a relatively new browser api, so I switched from the typeof and isFunction checks to a try/catch.

I also added a check that the output from Intl.DateTimeFormat().resolvedOptions().timeZone was actually loaded, logging an error if it wasn't.

@timrwood timrwood merged commit 1b05d56 into moment:develop Mar 1, 2016
@timrwood timrwood deleted the mj1856-tzguess branch March 1, 2016 17:12
This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants