From abe658d51aa73d0d0912379cd5b41e8819104642 Mon Sep 17 00:00:00 2001 From: Ben Allen Date: Wed, 24 Apr 2024 16:41:23 -0700 Subject: [PATCH] Editorial: fix typo in FormatNumericMinutes --- index.html | 2 +- spec.emu | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/index.html b/index.html index 86c9a84..2aceb17 100644 --- a/index.html +++ b/index.html @@ -2837,7 +2837,7 @@

1.1.9 FormatNumericHours ( durationFormat1.1.10 FormatNumericMinutes ( durationFormat, minutesValue, hoursDisplayed, signDisplayed )

The abstract operation FormatNumericMinutes takes arguments durationFormat (a DurationFormat Object), minutesValue (an integer), hoursDisplayed (a Boolean), and signDisplayed (a Boolean) and returns a List of Records. It creates a List of Records containing the formatted parts of minutesValue interpreted as the value of a Duration Record's [[Minutes]] field according to the effective locale and the formatting options of durationFormat. It performs the following steps when called:

-
  1. Let result be a new empty List.
  2. If hoursDisplayed is true, then
    1. Let separator be durationFormat.[[DigitalFormat]].[[HoursMinutesSeparator]].
    2. Append the Record { [[Type]]: "literal", [[Value]]: separator, [[Unit]]: empty } to result.
  3. Let minutesStyle be durationFormat.[[MinutesStyle]].
  4. Assert: minutesStyle is "numeric" or minutesStyle is "2-digit".
  5. Let nfOpts be OrdinaryObjectCreate(null).
  6. Let numberingSystem be durationFormat.[[NumberingSystem]].
  7. Perform ! CreateDataPropertyOrThrow(nfOpts, "numberingSystem", numberingSystem).
  8. If minutesStyle is "2-digit", then
    1. Perform ! CreateDataPropertyOrThrow(nfOpts, "minimumIntegerDigits", 2𝔽).
  9. If signDisplayed is false, then
    1. Perform ! CreateDataPropertyOrThrow(nfOpts, "signDisplay", "never").
  10. Let nf be ! Construct(%NumberFormat%, « durationFormat.[[Locale]] », nfOpts).
  11. Let minutesParts be ! PartitionNumberPattern(nf, minutesValue).
  12. For each Record { [[Type]], [[Value]] } part of minutesParts, do
    1. Append the Record { [[Type]]: part.[[Type]], [[Value]]: part.[[Value]], [[Unit]]: "minute" } to result.
  13. Return result.
+
  1. Let result be a new empty List.
  2. If hoursDisplayed is true, then
    1. Let separator be durationFormat.[[DigitalFormat]].[[HoursMinutesSeparator]].
    2. Append the Record { [[Type]]: "literal", [[Value]]: separator, [[Unit]]: empty } to result.
  3. Let minutesStyle be durationFormat.[[MinutesStyle]].
  4. Assert: minutesStyle is "numeric" or minutesStyle is "2-digit".
  5. Let nfOpts be OrdinaryObjectCreate(null).
  6. Let numberingSystem be durationFormat.[[NumberingSystem]].
  7. Perform ! CreateDataPropertyOrThrow(nfOpts, "numberingSystem", numberingSystem).
  8. If minutesStyle is "2-digit", then
    1. Perform ! CreateDataPropertyOrThrow(nfOpts, "minimumIntegerDigits", 2𝔽).
  9. If signDisplayed is false, then
    1. Perform ! CreateDataPropertyOrThrow(nfOpts, "signDisplay", "never").
  10. Let nf be ! Construct(%NumberFormat%, « durationFormat.[[Locale]], nfOpts »).
  11. Let minutesParts be ! PartitionNumberPattern(nf, minutesValue).
  12. For each Record { [[Type]], [[Value]] } part of minutesParts, do
    1. Append the Record { [[Type]]: part.[[Type]], [[Value]]: part.[[Value]], [[Unit]]: "minute" } to result.
  13. Return result.
diff --git a/spec.emu b/spec.emu index d2cf916..a0d5bac 100644 --- a/spec.emu +++ b/spec.emu @@ -352,7 +352,7 @@ contributors: Ujjwal Sharma, Younies Mahmoud 1. Perform ! CreateDataPropertyOrThrow(_nfOpts_, *"minimumIntegerDigits"*, *2*𝔽). 1. If _signDisplayed_ is *false*, then 1. Perform ! CreateDataPropertyOrThrow(_nfOpts_, *"signDisplay"*, *"never"*). - 1. Let _nf_ be ! Construct(%NumberFormat%, « _durationFormat_.[[Locale]] », _nfOpts_). + 1. Let _nf_ be ! Construct(%NumberFormat%, « _durationFormat_.[[Locale]], _nfOpts_ »). 1. Let _minutesParts_ be ! PartitionNumberPattern(_nf_, _minutesValue_). 1. For each Record { [[Type]], [[Value]] } _part_ of _minutesParts_, do 1. Append the Record { [[Type]]: _part_.[[Type]], [[Value]]: _part_.[[Value]], [[Unit]]: *"minute"* } to _result_.