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

−12:00, +12:45, +13:00, +13:45, +14:00 process as incorrect time zones #171

Closed
Semigradsky opened this issue Mar 9, 2022 · 5 comments
Closed

Comments

@Semigradsky
Copy link
Contributor

There is a breaking change in 1.3.0.

After 4ae1819 these time zones process as incorrect.
cc @marnusw

Is it a bug or date-fns-tz will no more work with these time zones?

References: −12:00, +12:45, +13:00, +13:45, +14:00

@marnusw
Copy link
Owner

marnusw commented Mar 25, 2022

OK, I take your point that this is a breaking change. That said, if these are not valid time zones then this was actually a bug fix which is why it was included.

Can you provide references indicating that these are indeed valid time zones? Are they not capped at -11:59 and +12:00?

@Semigradsky
Copy link
Contributor Author

I has the references that it is a "valid UTC offset" - https://en.wikipedia.org/wiki/List_of_UTC_time_offsets, https://en.wikipedia.org/wiki/List_of_tz_database_time_zones

Also I see that this offsets works with new Temporal object:

Temporal.TimeZone.from('-12:00') // okay
Temporal.TimeZone.from('-23:59') // okay
Temporal.TimeZone.from('-24:00') // Uncaught RangeError: Invalid time zone: -24:00

Temporal.TimeZone.from('+14:00') // okay
Temporal.TimeZone.from('+23:59') // okay
Temporal.TimeZone.from('+24:00') // Uncaught RangeError: Invalid time zone: +24:00

https://github.com/tc39/proposal-temporal/blob/47765713c747da13b094247053534b2d2fed0bdf/polyfill/lib/regex.mjs#L17

Would be nice to have the same limitations as future native implementation.

@marnusw
Copy link
Owner

marnusw commented Mar 28, 2022

Thank you @Semigradsky, we can certainly match what Temporal supports in your example above. It's an easy fix, so if you need it urgently and have the time please submit a PR, but I'll do it when I can.

@Semigradsky
Copy link
Contributor Author

I will try 👍

Semigradsky added a commit to Semigradsky/date-fns-tz that referenced this issue Mar 28, 2022
@marnusw
Copy link
Owner

marnusw commented Mar 31, 2022

Released in v1.3.2.

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

No branches or pull requests

2 participants