You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Normative: Allow annotations after YYYY-MM and MM-DD
In keeping with the IXDTF format which extends the grammar of RFC 3339
with any number of annotations, we should allow annotations after the
short YYYY-MM PlainYearMonth and MM-DD PlainMonthDay forms.
If we were to allow UTC offsets ±UU[:UU] alongside the time zone
annotation, that would be ambiguous in one case: YYYY-MM-UU would be
ambiguous with YYYY-MM-DD. This forced us to take another look at ISO 8601
and realize that YYYY-MM-DD-UU and YYYY-MM-DDZ are actually not defined by
ISO 8601. Although they are not forbidden either, but we don't have any
reason to introduce this notation given the set of Temporal types.
Therefore, UTC offsets are disallowed after any date-only notation (that
is, YYYY-MM-DD, YYYY-MM, and MM-DD.)
Closes: #2379
<emu-note>The value of ! ToIntegerOrInfinity(*undefined*) is 0.</emu-note>
1229
1222
<emu-alg>
1230
1223
1. Let _parseResult_ be ~empty~.
1231
-
1. For each nonterminal _goal_ of «|TemporalDateTimeString|, |TemporalInstantString|, |TemporalMonthDayString|, |TemporalTimeString|, |TemporalYearMonthString|, |TemporalZonedDateTimeString|», do
1224
+
1. For each nonterminal _goal_ of «|TemporalDateTimeString|, |TemporalInstantString|, |TemporalTimeString|, |TemporalZonedDateTimeString|», do
1232
1225
1. If _parseResult_ is not a Parse Node, set _parseResult_ to ParseText(StringToCodePoints(_isoString_), _goal_).
1226
+
1. For each nonterminal _goal_ of «|TemporalMonthDayString|, |TemporalYearMonthString|», do
1227
+
1. If _parseResult_ is not a Parse Node, then
1228
+
1. Set _parseResult_ to ParseText(StringToCodePoints(_isoString_), _goal_).
1229
+
1. If _parseResult_ is a Parse Node, then
1230
+
1. For each |Annotation| Parse Node _annotation_ contained within _parseResult_, do
1231
+
1. Let _key_ be the source text matched by the |AnnotationKey| Parse Node contained within _annotation_.
1232
+
1. Let _value_ be the source text matched by the |AnnotationValue| Parse Node contained within _annotation_.
1233
+
1. If CodePointsToString(_key_) is *"u-ca"* and the ASCII-lowercase of CodePointsToString(_value_) is not *"iso8601"*, throw a *RangeError* exception.
1233
1234
1. If _parseResult_ is not a Parse Node, throw a *RangeError* exception.
1234
1235
1. Let each of _year_, _month_, _day_, _hour_, _minute_, _second_, and _fSeconds_ be the source text matched by the respective |DateYear|, |DateMonth|, |DateDay|, |TimeHour|, |TimeMinute|, |TimeSecond|, and |TimeFraction| Parse Node contained within _parseResult_, or an empty sequence of code points if not present.
1235
1236
1. If the first code point of _year_ is U+2212 (MINUS SIGN), replace the first code point with U+002D (HYPHEN-MINUS).
@@ -1500,7 +1501,7 @@ <h1>
1500
1501
<emu-alg>
1501
1502
1. Let _parseResult_ be ParseText(StringToCodePoints(_isoString_), |TemporalDateTimeString|).
1502
1503
1. If _parseResult_ is a List of errors, throw a *RangeError* exception.
1503
-
1. If _parseResult_ contains a |UTCDesignator| ParseNode but no |TimeZoneBracketedAnnotation| Parse Node, throw a *RangeError* exception.
1504
+
1. If _parseResult_ contains a |UTCDesignator| ParseNode but no |TimeZoneAnnotation| Parse Node, throw a *RangeError* exception.
0 commit comments