Skip to content

Commit

Permalink
Editorial: Clarify relationship between standards in grammar section
Browse files Browse the repository at this point in the history
  • Loading branch information
ptomato committed Jan 14, 2025
1 parent 67da21b commit c79b9ce
Showing 1 changed file with 13 additions and 10 deletions.
23 changes: 13 additions & 10 deletions spec/abstractops.html
Original file line number Diff line number Diff line change
Expand Up @@ -1015,22 +1015,18 @@ <h1>ISO 8601 / RFC 9557 grammar</h1>
Several operations in this section are intended to parse ISO 8601 / RFC 9557 strings representing a date, a time, a duration, or a combined date and time.
For the purposes of these operations, a valid ISO 8601 / RFC 9557 string is defined as a string that can be generated by one of the goal elements of the following grammar.
</p>
<p>This grammar is adapted from the ABNF grammar of ISO 8601 that is given in appendix A of <a href="https://tools.ietf.org/html/rfc3339#appendix-A">RFC 3339</a>, augmented with the grammar of annotations in section 3.1 of <a href="https://datatracker.ietf.org/doc/html/draft-ietf-sedate-datetime-extended#section-3.1">Date and Time on the Internet: Timestamps with additional information</a></p>
<p>The grammar deviates from the standard given in ISO 8601 in the following ways:</p>
<p>This grammar is adapted from the ABNF grammar of ISO 8601 that is given in appendix A of <a href="https://tools.ietf.org/html/rfc3339#appendix-A">RFC 3339</a>, augmented with the grammar of annotations in section 4.1 of <a href="https://datatracker.ietf.org/doc/html/rfc9557#name-abnf">RFC 9557</a></p>
<p>
ISO 8601 defines a number of optional deviations that are allowed "by agreement between the communicating parties".
The grammar deviates from the standard given in ISO 8601 in the following ways:
</p>
<ul>
<li>Only the calendar date format is supported, not the weekdate or ordinal date format.</li>
<li>Two-digit years are disallowed.</li>
<li><a href="https://tc39.es/ecma262/#sec-expanded-years">Expanded Years</a> of 6 digits are allowed.</li>
<li>Fractional parts may have 1 through 9 decimal places.</li>
<li>In time representations, only seconds are allowed to have a fractional part.</li>
<li>In duration representations, only hours, minutes, and seconds are allowed to have a fractional part.</li>
<li>
Any number of conforming <a href="https://datatracker.ietf.org/doc/html/draft-ietf-sedate-datetime-extended#section-3.1">suffixes in square brackets</a> are allowed.
However, the only recognized suffixes are time zone and <a href="https://tools.ietf.org/html/bcp47#section-2.1">BCP 47 calendar</a>.
Others are ignored, unless they are prefixed with `!`, in which case they are rejected.
Note that the suffix keys, although they look similar, are not the same as keys in <a href="https://www.rfc-editor.org/rfc/rfc6067.html">RFC 6067</a>.
In particular, <a href="https://datatracker.ietf.org/doc/html/draft-ietf-sedate-datetime-extended#section-3.1-4">keys are lowercase-only</a>.
</li>
<li>A space may be used to separate the date and time in a combined date / time representation, but not in a duration (e.g., *"1970-01-01 00:00Z"* is valid but *"P1D 1H"* is not).</li>
<li>Alphabetic designators may be in lower or upper case (e.g., *"1970-01-01t00:00Z"* and *"1970-01-01T00:00z"* and *"pT1m"* are valid).</li>
<li>Period or comma may be used as the decimal separator (e.g., *"PT1,00H"* is a valid representation of a 1-hour duration).</li>
Expand All @@ -1043,8 +1039,15 @@ <h1>ISO 8601 / RFC 9557 grammar</h1>
</li>
<li>When parsing a date representation without a day for a Temporal.PlainYearMonth, the expression is allowed to be in basic format (with no separator symbols).</li>
<li>A duration specifier of *"W"* (weeks) can be combined with any of the other specifiers (e.g., *"P1M1W1D"* is valid).</li>
<li>Anything else described by the standard as requiring mutual agreement between communicating parties, is disallowed.</li>
<li>Anything else described by ISO 8601 as requiring mutual agreement between communicating parties, is disallowed.</li>
</ul>
<p>
In addition to the above deviations, any number of conforming <a href="https://datatracker.ietf.org/doc/html/rfc9557#name-abnf">RFC 9557 suffixes in square brackets</a> are allowed.
However, the only recognized suffixes are time zone and <a href="https://tools.ietf.org/html/bcp47#section-2.1">BCP 47 calendar</a>.
Others are ignored, unless they are prefixed with `!`, in which case they are rejected.
Note that the suffix keys, although they look similar, are not the same as keys in <a href="https://www.rfc-editor.org/rfc/rfc6067.html">RFC 6067</a>.
In particular, <a href="https://datatracker.ietf.org/doc/html/rfc9557#section-3.1-4">keys are lowercase-only</a>.
</p>

<emu-grammar type="definition">
Alpha ::: one of
Expand Down

0 comments on commit c79b9ce

Please sign in to comment.