Skip to content

Commit b52e320

Browse files
anbaptomato
authored andcommitted
Editorial: Remove update for FormatDateTimePattern which was already upstreamed
1 parent 87ba571 commit b52e320

File tree

1 file changed

+0
-105
lines changed

1 file changed

+0
-105
lines changed

spec/intl.html

Lines changed: 0 additions & 105 deletions
Original file line numberDiff line numberDiff line change
@@ -718,111 +718,6 @@ <h1>DateTime Format Functions</h1>
718718
<p>The *"length"* property of a DateTime format function is *1*<sub>𝔽</sub>.</p>
719719
</emu-clause>
720720

721-
<emu-clause id="sec-formatdatetimepattern" type="abstract operation">
722-
<h1>
723-
FormatDateTimePattern (
724-
_dateTimeFormat_: an Intl.DateTimeFormat,
725-
_format_: a DateTime Format Record or a DateTime Range Pattern Format Record,
726-
_pattern_: a Pattern String,
727-
<del>_x_: a Number,</del>
728-
<ins>_epochNanoseconds_: a BigInt,</ins>
729-
): a List of Records with fields [[Type]] (a String) and [[Value]] (a String)
730-
</h1>
731-
<dl class="header">
732-
<dt>description</dt>
733-
<dd>It <del>interprets _x_ as a time value as specified in es2024, <emu-xref href="#sec-time-values-and-time-range"></emu-xref>, and</del> creates the corresponding parts <ins>for the epoch time _epochNanoseconds_</ins> according to _pattern_ and to the effective locale and the formatting options of _dateTimeFormat_ and _format_.</dd>
734-
</dl>
735-
<emu-alg>
736-
1. <del>Let _x_ be TimeClip(_x_).</del>
737-
1. <del>If _x_ is *NaN*, throw a *RangeError* exception.</del>
738-
1. Let _locale_ be _dateTimeFormat_.[[Locale]].
739-
1. Let _nfOptions_ be OrdinaryObjectCreate(*null*).
740-
1. Perform ! CreateDataPropertyOrThrow(_nfOptions_, *"useGrouping"*, *false*).
741-
1. Let _nf_ be ! Construct(%Intl.NumberFormat%, « _locale_, _nfOptions_ »).
742-
1. Let _nf2Options_ be OrdinaryObjectCreate(*null*).
743-
1. Perform ! CreateDataPropertyOrThrow(_nf2Options_, *"minimumIntegerDigits"*, *2*<sub>𝔽</sub>).
744-
1. Perform ! CreateDataPropertyOrThrow(_nf2Options_, *"useGrouping"*, *false*).
745-
1. Let _nf2_ be ! Construct(%Intl.NumberFormat%, « _locale_, _nf2Options_ »).
746-
1. If _format_ has a field [[fractionalSecondDigits]], then
747-
1. Let _fractionalSecondDigits_ be _format_.[[fractionalSecondDigits]].
748-
1. Let _nf3Options_ be OrdinaryObjectCreate(*null*).
749-
1. Perform ! CreateDataPropertyOrThrow(_nf3Options_, *"minimumIntegerDigits"*, 𝔽(_fractionalSecondDigits_)).
750-
1. Perform ! CreateDataPropertyOrThrow(_nf3Options_, *"useGrouping"*, *false*).
751-
1. Let _nf3_ be ! Construct(%Intl.NumberFormat%, « _locale_, _nf3Options_ »).
752-
1. Let _tm_ be ToLocalTime(<del>ℤ(ℝ(_x_) × 10<sup>6</sup>)</del><ins>_epochNanoseconds_</ins>, _dateTimeFormat_.[[Calendar]], _dateTimeFormat_.[[TimeZone]]).
753-
1. Let _patternParts_ be PartitionPattern(_pattern_).
754-
1. Let _result_ be a new empty List.
755-
1. For each Record { [[Type]], [[Value]] } _patternPart_ of _patternParts_, do
756-
1. Let _p_ be _patternPart_.[[Type]].
757-
1. If _p_ is *"literal"*, then
758-
1. Append the Record { [[Type]]: *"literal"*, [[Value]]: _patternPart_.[[Value]] } to _result_.
759-
1. Else if _p_ is *"fractionalSecondDigits"*, then
760-
1. Assert: _format_ has a field [[fractionalSecondDigits]].
761-
1. Let _v_ be _tm_.[[Millisecond]].
762-
1. Set _v_ to floor(_v_ × 10<sup>( _fractionalSecondDigits_ - 3 )</sup>).
763-
1. Let _fv_ be FormatNumeric(_nf3_, _v_).
764-
1. Append the Record { [[Type]]: *"fractionalSecond"*, [[Value]]: _fv_ } to _result_.
765-
1. Else if _p_ is *"dayPeriod"*, then
766-
1. Assert: _format_ has a field [[dayPeriod]].
767-
1. Let _f_ be _format_.[[dayPeriod]].
768-
1. Let _fv_ be a String value representing the day period of _tm_ in the form given by _f_; the String value depends upon the implementation and the effective locale of _dateTimeFormat_.
769-
1. Append the Record { [[Type]]: _p_, [[Value]]: _fv_ } to _result_.
770-
1. Else if _p_ is *"timeZoneName"*, then
771-
1. Assert: _format_ has a field [[timeZoneName]].
772-
1. Let _f_ be _format_.[[timeZoneName]].
773-
1. Let _v_ be _dateTimeFormat_.[[TimeZone]].
774-
1. Let _fv_ be a String value representing _v_ in the form given by _f_; the String value depends upon the implementation and the effective locale of _dateTimeFormat_. The String value may also depend on the value of the [[InDST]] field of _tm_ if _f_ is *"short"*, *"long"*, *"shortOffset"*, or *"longOffset"*. If the implementation does not have such a localized representation of _f_, then use the String value of _v_ itself.
775-
1. Append the Record { [[Type]]: _p_, [[Value]]: _fv_ } to _result_.
776-
1. Else if _p_ matches a Property column of the row in <emu-xref href="#table-datetimeformat-components"></emu-xref>, then
777-
1. Assert: _format_ has a field [[&lt;_p_>]].
778-
1. Let _f_ be _format_.[[&lt;_p_>]].
779-
1. Let _v_ be the value of _tm_'s field whose name is the Internal Slot column of the matching row.
780-
1. If _p_ is *"year"* and _v_ ≤ 0, set _v_ to 1 - _v_.
781-
1. If _p_ is *"month"*, set _v_ to _v_ + 1.
782-
1. If _p_ is *"hour"* and _dateTimeFormat_.[[HourCycle]] is *"h11"* or *"h12"*, then
783-
1. Set _v_ to _v_ modulo 12.
784-
1. If _v_ is 0 and _dateTimeFormat_.[[HourCycle]] is *"h12"*, set _v_ to 12.
785-
1. If _p_ is *"hour"* and _dateTimeFormat_.[[HourCycle]] is *"h24"*, then
786-
1. If _v_ is 0, set _v_ to 24.
787-
1. If _f_ is *"numeric"*, then
788-
1. Let _fv_ be FormatNumeric(_nf_, _v_).
789-
1. Else if _f_ is *"2-digit"*, then
790-
1. Let _fv_ be FormatNumeric(_nf2_, _v_).
791-
1. Let _codePoints_ be StringToCodePoints(_fv_).
792-
1. Let _count_ be the number of elements in _codePoints_.
793-
1. If _count_ > 2, then
794-
1. Let _tens_ be _codePoints_[_count_ - 2].
795-
1. Let _ones_ be _codePoints_[_count_ - 1].
796-
1. Set _fv_ to CodePointsToString(« _tens_, _ones_ »).
797-
1. Else if _f_ is *"narrow"*, *"short"*, or *"long"*, then
798-
1. Let _fv_ be a String value representing _v_ in the form given by _f_; the String value depends upon the implementation and the effective locale and calendar of _dateTimeFormat_. If _p_ is *"month"*, then the String value may also depend on whether _format_.[[day]] is present. If the implementation does not have a localized representation of _f_, then use the String value of _v_ itself.
799-
1. Append the Record { [[Type]]: _p_, [[Value]]: _fv_ } to _result_.
800-
1. Else if _p_ is *"ampm"*, then
801-
1. Let _v_ be _tm_.[[Hour]].
802-
1. If _v_ is greater than 11, then
803-
1. Let _fv_ be an implementation and locale dependent String value representing *"post meridiem"*.
804-
1. Else,
805-
1. Let _fv_ be an implementation and locale dependent String value representing *"ante meridiem"*.
806-
1. Append the Record { [[Type]]: *"dayPeriod"*, [[Value]]: _fv_ } to _result_.
807-
1. Else if _p_ is *"relatedYear"*, then
808-
1. Let _v_ be _tm_.[[RelatedYear]].
809-
1. Let _fv_ be FormatNumeric(_nf_, _v_).
810-
1. Append the Record { [[Type]]: *"relatedYear"*, [[Value]]: _fv_ } to _result_.
811-
1. Else if _p_ is *"yearName"*, then
812-
1. Let _v_ be _tm_.[[YearName]].
813-
1. Let _fv_ be an implementation and locale dependent String value representing _v_.
814-
1. Append the Record { [[Type]]: *"yearName"*, [[Value]]: _fv_ } to _result_.
815-
1. Else,
816-
1. Let _unknown_ be an implementation-, locale-, and numbering system-dependent String based on <del>_x_</del><ins>_epochNanoseconds_</ins> and _p_.
817-
1. Append the Record { [[Type]]: *"unknown"*, [[Value]]: _unknown_ } to _result_.
818-
1. Return _result_.
819-
</emu-alg>
820-
821-
<emu-note>
822-
It is recommended that implementations use the locale and calendar dependent strings provided by the Common Locale Data Repository (available at <a href="https://cldr.unicode.org/">https://cldr.unicode.org/</a>), and use CLDR *"abbreviated"* strings for DateTimeFormat *"short"* strings, and CLDR *"wide"* strings for DateTimeFormat *"long"* strings.
823-
</emu-note>
824-
</emu-clause>
825-
826721
<emu-clause id="sec-partitiondatetimepattern" type="abstract operation">
827722
<h1>
828723
PartitionDateTimePattern (

0 commit comments

Comments
 (0)