Editorial: refactor time zone offset handling (prepare for #2607) #2621
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.