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

IANA timezone support #676

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

IANA timezone support #676

wants to merge 1 commit into from

Conversation

benmccann
Copy link
Contributor

@benmccann benmccann commented Jan 28, 2018

This uses the DateTimeFormat API. IE users only need the Intl.DateTimeFormat timezone polyfill. Edge users do not need a polyfill

This was referenced Jan 30, 2018
@benmccann benmccann force-pushed the timezone branch 3 times, most recently from 6c58e0b to b635591 Compare February 7, 2018 04:20
@benmccann
Copy link
Contributor Author

@leshakoss @kossnocorp I've updated this PR with some tests and details for supporting IE. Would love your feedback on this.

@@ -64,6 +64,7 @@ var patterns = {
* @param {*} argument - the value to convert
* @param {Options} [options] - the object with options. See [Options]{@link https://date-fns.org/docs/Options}
* @param {0|1|2} [options.additionalDigits=2] - the additional number of digits in the extended year format
* @param {string} [options.tz] - the time zone to use. Default is local time. Valid options are 'UTC' or Area/Location such as 'America/Cancun'.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The tz option is nice and short, but I wonder if it's not worthwhile, just in the interest of consistency across different APIs, to name this option timeZone as used in the Intl API itself?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I debated that myself. Given that both you and @leshakoss have indicated a preference for it, I've updated it accordingly

@benmccann benmccann force-pushed the timezone branch 2 times, most recently from b5805fe to 2263383 Compare February 16, 2018 17:58
@marnusw
Copy link
Contributor

marnusw commented Feb 17, 2018

I have written some documentation for helper functions that might be built around this idea to solve the issues presented in #180 and will create a separate PR with those when they are ready and depending on further discussion in #660. For now any feedback on the documentation would be most welcome.

@benmccann
Copy link
Contributor Author

I'll leave this open for reference for the time being, but @marnusw has taken this PR even further, so probably best that we focus on that one in terms of review and being merged

@kossnocorp
Copy link
Member

Wow, this is a really elegant solution, love it! Thank you a lot! We'll evaluate this as soon as we finish with v2. Sorry for waiting.

@kossnocorp kossnocorp added this to the v2+ milestone May 10, 2018
@Restuta
Copy link

Restuta commented Feb 12, 2019

@kossnocorp I wonder if there any news on this? Any way we can help?

@palpich
Copy link

palpich commented Dec 18, 2019

+1 for this feature

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.

None yet

5 participants