-
Notifications
You must be signed in to change notification settings - Fork 172
Normative: Allow ISO strings with "Z" + a bracketed IANA name #1749
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
Conversation
|
Tests to follow. |
|
(Also, marking as draft because normative) |
Codecov Report
@@ Coverage Diff @@
## main #1749 +/- ##
==========================================
+ Coverage 94.85% 94.91% +0.06%
==========================================
Files 19 19
Lines 10882 10807 -75
Branches 1729 1736 +7
==========================================
- Hits 10322 10258 -64
+ Misses 547 536 -11
Partials 13 13
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
justingrant
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
0e88e8e to
71eff06
Compare
|
This change achieved consensus in TC39. @Ms2ger Do you want to take a final look at the tests I added recently? |
Previously we had decided to always throw on these strings. Based on feedback from the IETF SEDATE working group, we are going to allow them. This means changes to what kinds of strings are allowed in several contexts. See #1695 for more information. The following diagram may be helpful when reading this commit. "datetime" = e.g. "2021-08-19T17:30" "offset" = e.g. "-07:00" "bracket" = e.g. "[America/Vancouver]", "[-07:00]" or "[UTC]" TimeZone.from: - datetime + Z -> UTC - datetime + offset -> offset time zone - datetime + bracket -> IANA time zone - datetime + Z + bracket -> " - datetime + offset + bracket -> " - throws on a bare datetime string ZonedDateTime.from: - datetime + bracket -> preserve wall time in the IANA time zone - datetime + Z + bracket -> preserve exact time in the IANA time zone - datetime + offset + bracket -> consult offset option if ambiguous - throws on a string with no bracket Instant.from: - datetime + Z -> preserve exact time - datetime + offset -> " - datetime + Z + bracket -> preserve exact time, ignore bracket - datetime + offset + bracket -> " - throws on a bare datetime string, or datetime + bracket relativeTo: - datetime + bracket -> do what ZonedDateTime.from does - datetime + Z + bracket -> " - datetime + offset + bracket -> " - anything else -> do what PlainDateTime.from does Closes: #1695 Closes: #1696
71eff06 to
9a2bf1d
Compare
Previously we had decided to always throw on these strings. Based on
feedback from the IETF SEDATE working group, we are going to allow them.
This means changes to what kinds of strings are allowed in several
contexts. See #1695 for more information.
The following diagram may be helpful when reading this commit.
"datetime" = e.g. "2021-08-19T17:30"
"offset" = e.g. "-07:00"
"bracket" = e.g. "[America/Vancouver]", "[-07:00]" or "[UTC]"
TimeZone.from:
ZonedDateTime.from:
Instant.from:
relativeTo:
Closes: #1695
Closes: #1696