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
The repeated normative change in the previous commit goes into its own
abstract operation, MaybeFormatCalendarAnnotation.
While we are at it, updates FormatCalendarAnnotation to use a structured
header, and updates the link in the editor's note.
The abstract operation FormatCalendarAnnotation returns a string with a calendar annotation suitable for concatenating to the end of an ISO 8601 string.
396
-
Depending on the given _id_ and value of _showCalendar_, the string may be empty if no calendar annotation need be included.
The exact form this annotation will take is undergoing a standardization process in the IETF; it is being discussed in the Internet Draft <ahref="https://ryzokuken.dev/draft-ryzokuken-datetime-extended/documents/rfc-3339.html#name-internet-date-time-format">Date and Time on the Internet: Timestamps with additional information</a>.
413
+
The exact form this annotation will take is undergoing a standardization process in the IETF; it is being discussed in the Internet Draft <ahref="https://datatracker.ietf.org/doc/html/draft-ietf-sedate-datetime-extended">Date and Time on the Internet: Timestamps with additional information</a>.
_showCalendar_: one of *"auto"*, *"always"*, or *"never"*,
422
+
): a String
423
+
</h1>
424
+
<dlclass="header">
425
+
<dt>description</dt>
426
+
<dd>
427
+
It returns a string with a calendar annotation suitable for concatenating to the end of an ISO 8601 string.
428
+
Depending on the given _id_ and value of _showCalendar_, the string may be empty if no calendar annotation need be included.
429
+
</dd>
430
+
</dl>
401
431
<emu-alg>
402
-
1.Assert:_showCalendar_ is *"auto"*, *"always"*, or *"never"*.
403
432
1. If _showCalendar_ is *"never"*, return the empty String.
404
433
1. If _showCalendar_ is *"auto"* and _id_ is *"iso8601"*, return the empty String.
405
434
1. Return the string-concatenation of *"[u-ca="*, _id_, and *"]"*.
406
435
</emu-alg>
436
+
<emu-notetype="editor">
437
+
The exact form this annotation will take is undergoing a standardization process in the IETF; it is being discussed in the Internet Draft <ahref="https://datatracker.ietf.org/doc/html/draft-ietf-sedate-datetime-extended">Date and Time on the Internet: Timestamps with additional information</a>.
1. Let _year_ be ! PadISOYear(_temporalDate_.[[ISOYear]]).
888
888
1. Let _month_ be ToZeroPaddedDecimalString(_temporalDate_.[[ISOMonth]], 2).
889
889
1. Let _day_ be ToZeroPaddedDecimalString(_temporalDate_.[[ISODay]], 2).
890
-
1. If _showCalendar_ is *"never"*, then
891
-
1. Let _calendar_ be the empty String.
892
-
1. Else,
893
-
1. Let _calendarID_ be ? ToString(_temporalDate_.[[Calendar]]).
894
-
1. Let _calendar_ be ! FormatCalendarAnnotation(_calendarID_, _showCalendar_).
890
+
1. Let _calendar_ be ? MaybeFormatCalendarAnnotation(_temporalDate_.[[Calendar]], _showCalendar_).
895
891
1. Return the string-concatenation of _year_, the code unit 0x002D (HYPHEN-MINUS), _month_, the code unit 0x002D (HYPHEN-MINUS), _day_, and _calendar_.
1. Let _hour_ be ToZeroPaddedDecimalString(_hour_, 2).
965
965
1. Let _minute_ be ToZeroPaddedDecimalString(_minute_, 2).
966
966
1. Let _seconds_ be ! FormatSecondsStringPart(_second_, _millisecond_, _microsecond_, _nanosecond_, _precision_).
967
-
1. If _showCalendar_ is *"never"*, then
968
-
1. Let _calendarString_ be the empty String.
969
-
1. Else,
970
-
1. Let _calendarID_ be ? ToString(_calendar_).
971
-
1. Let _calendarString_ be ! FormatCalendarAnnotation(_calendarID_, _showCalendar_).
967
+
1. Let _calendarString_ be ? MaybeFormatCalendarAnnotation(_calendar_, _showCalendar_).
972
968
1. Return the string-concatenation of _year_, the code unit 0x002D (HYPHEN-MINUS), _month_, the code unit 0x002D (HYPHEN-MINUS), _day_, 0x0054 (LATIN CAPITAL LETTER T), _hour_, the code unit 0x003A (COLON), _minute_, _seconds_, and _calendarString_.
Copy file name to clipboardExpand all lines: spec/zoneddatetime.html
+1-5Lines changed: 1 addition & 5 deletions
Original file line number
Diff line number
Diff line change
@@ -1196,11 +1196,7 @@ <h1>
1196
1196
1. Else,
1197
1197
1. Let _timeZoneID_ be ? ToString(_timeZone_).
1198
1198
1. Let _timeZoneString_ be the string-concatenation of the code unit 0x005B (LEFT SQUARE BRACKET), _timeZoneID_, and the code unit 0x005D (RIGHT SQUARE BRACKET).
1199
-
1. If _showCalendar_ is *"never"*, then
1200
-
1. Let _calendarString_ be the empty String.
1201
-
1. Else,
1202
-
1. Let _calendarID_ be ? ToString(_zonedDateTime_.[[Calendar]]).
1203
-
1. Let _calendarString_ be ! FormatCalendarAnnotation(_calendarID_, _showCalendar_).
1199
+
1. Let _calendarString_ be ? MaybeFormatCalendarAnnotation(_zonedDateTime_.[[Calendar]], _showCalendar_).
1204
1200
1. Return the string-concatenation of _dateTimeString_, _offsetString_, _timeZoneString_, and _calendarString_.
0 commit comments