-
Notifications
You must be signed in to change notification settings - Fork 154
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
Editorial: refactor time zone offset handling (prepare for #2607) #2621
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Codecov Report
@@ Coverage Diff @@
## main #2621 +/- ##
=======================================
Coverage 95.98% 95.98%
=======================================
Files 20 20
Lines 11572 11574 +2
Branches 2198 2201 +3
=======================================
+ Hits 11107 11109 +2
Misses 401 401
Partials 64 64
|
gibson042
approved these changes
Jun 28, 2023
justingrant
force-pushed
the
offset-id-refactor
branch
5 times, most recently
from
June 29, 2023 04:42
a16dd78
to
2ed580c
Compare
This commit refactors spec text and polyfill code for time zone offsets, especially to split the handling of offsets in ISO strings from offsets used as time zone identifiers. This will help prepare for a later normative commit where time zone identifiers are limited to minutes precision while ISO string offset inputs and ZonedDateTime's `offset` property still support nanosecond precision.
justingrant
force-pushed
the
offset-id-refactor
branch
from
June 29, 2023 04:50
2ed580c
to
90f0ab2
Compare
moz-v2v-gh
pushed a commit
to mozilla/gecko-dev
that referenced
this pull request
Sep 13, 2023
Implements the changes from: - tc39/proposal-temporal#2621 - tc39/proposal-temporal#2622 - tc39/proposal-temporal#2632 - tc39/proposal-temporal#2607 Differential Revision: https://phabricator.services.mozilla.com/D185412
vinnydiehl
pushed a commit
to vinnydiehl/mozilla-unified
that referenced
this pull request
Sep 14, 2023
Implements the changes from: - tc39/proposal-temporal#2621 - tc39/proposal-temporal#2622 - tc39/proposal-temporal#2632 - tc39/proposal-temporal#2607 Differential Revision: https://phabricator.services.mozilla.com/D185412
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR refactors spec text and polyfill code for time zone offsets, splitting the handling of offsets used as time zone identifiers from offsets used for ZDT's
offset
property (both parsing and output), and for parsing of Instant and the RFC3339 portion of ZDT strings.This split will prepare for the normative changes in #2607 and will make the normative PR easier to review.
Here's more details about what's in this PR:
|UTCOffset|
production into|UTCOffsetMinutePrecision|
and|UTCOffsetSubMinutePrecision|
.IsTimeZoneOffsetString
, throwing if it'sfalse
, and then callingParseTimeZoneOffsetString
. Instead, offset-parsing AOs (like other Temporal parsing AOs) will throw if they're provided with an invalid string, which lets us replace two AO calls and anIf
statement with a single call to a parsing AO.ParseTimeZoneOffsetString
into two new AOs for parsing ISO string offsets and offset time zone identifiers, respectively. Both return Records instead of primtives:ParseUTCOffsetString
returns { [[OffsetNanoseconds]: an integer, [[HasSubMinutePrecision]]: a Boolean }ParseTimeZoneIdentifier
returns { [[Name]]: a String or~empty~
, [[OffsetNanoseconds]]: an integer or~empty~
}IsTimeZoneOffsetString
toIsOffsetTimeZoneIdentifier
.<ins>
and<del>
in structured headers in order to support the renames above.