?
u
/
p
1-9
A Duration Record is a
Duration Records have the fields listed in
Field | Meaning |
---|---|
[[Years]] | The number of years in the duration. |
[[Months]] | The number of months in the duration. |
[[Weeks]] | The number of weeks in the duration. |
[[Days]] | The number of days in the duration. |
[[Hours]] | The number of hours in the duration. |
[[Minutes]] | The number of minutes in the duration. |
[[Seconds]] | The number of seconds in the duration. |
[[Milliseconds]] | The number of milliseconds in the duration. |
[[Microseconds]] | The number of microseconds in the duration. |
[[Nanoseconds]] | The number of nanoseconds in the duration. |
The abstract operation ToIntegerIfIntegral takes argument argument (an
The abstract operation ToDurationRecord takes argument input (an
The abstract operation DurationSign takes argument duration (a
The abstract operation IsValidDuration takes arguments years (an
std::remquo()
with sufficient bits in the quotient. String manipulation will also give an exact result, since the multiplication is by a power of 10.The abstract operation GetDurationUnitOptions takes arguments unit (a String), options (an Object), baseStyle (a String), stylesList (a
The abstract operation ComputeFractionalDigits takes arguments durationFormat (a DurationFormat Object) and duration (a
The abstract operation NextUnitFractional takes arguments durationFormat (a DurationFormat Object) and unit (a String) and returns a Boolean. It returns
The abstract operation FormatNumericHours takes arguments durationFormat (a DurationFormat object), hoursValue (an
The abstract operation FormatNumericMinutes takes arguments durationFormat (a DurationFormat Object), minutesValue (an
The abstract operation FormatNumericSeconds takes arguments durationFormat (a DurationFormat Object), secondsValue (a
The abstract operation FormatNumericUnits takes arguments durationFormat (a DurationFormat Object), duration (a
The abstract operation ListFormatParts takes arguments durationFormat (a DurationFormat Object) and partitionedPartsList (a
The abstract operation PartitionDurationFormatPattern takes arguments durationFormat (a DurationFormat) and duration (a
Value Field | Style Slot | Display Slot | Unit | NumberFormat Unit |
---|---|---|---|---|
[[Years]] | [[YearsStyle]] | [[YearsDisplay]] | ||
[[Months]] | [[MonthsStyle]] | [[MonthsDisplay]] | ||
[[Weeks]] | [[WeeksStyle]] | [[WeeksDisplay]] | ||
[[Days]] | [[DaysStyle]] | [[DaysDisplay]] | ||
[[Hours]] | [[HoursStyle]] | [[HoursDisplay]] | ||
[[Minutes]] | [[MinutesStyle]] | [[MinutesDisplay]] | ||
[[Seconds]] | [[SecondsStyle]] | [[SecondsDisplay]] | ||
[[Milliseconds]] | [[MillisecondsStyle]] | [[MillisecondsDisplay]] | ||
[[Microseconds]] | [[MicrosecondsStyle]] | [[MicrosecondsDisplay]] | ||
[[Nanoseconds]] | [[NanosecondsStyle]] | [[NanosecondsDisplay]] |
The DurationFormat
When the Intl.DurationFormat
function is called with optional arguments locales and options, the following steps are taken:
type
nonterminal, throw a Style Slot | Display Slot | Unit | Values | Digital Default |
---|---|---|---|---|
[[YearsStyle]] | [[YearsDisplay]] | « |
||
[[MonthsStyle]] | [[MonthsDisplay]] | « |
||
[[WeeksStyle]] | [[WeeksDisplay]] | « |
||
[[DaysStyle]] | [[DaysDisplay]] | « |
||
[[HoursStyle]] | [[HoursDisplay]] | « |
||
[[MinutesStyle]] | [[MinutesDisplay]] | « |
||
[[SecondsStyle]] | [[SecondsDisplay]] | « |
||
[[MillisecondsStyle]] | [[MillisecondsDisplay]] | « |
||
[[MicrosecondsStyle]] | [[MicrosecondsDisplay]] | « |
||
[[NanosecondsStyle]] | [[NanosecondsDisplay]] | « |
The Intl.DurationFormat
The value of Intl.DurationFormat.prototype
is
This property has the attributes { [[Writable]]:
When the supportedLocalesOf
method is called with arguments locales and options, the following steps are taken:
The value of the [[AvailableLocales]] internal slot is implementation defined within the constraints described in
The value of the [[RelevantExtensionKeys]] internal slot is «
The value of the [[LocaleData]] internal slot is implementation defined within the constraints described in
The Intl.DurationFormat prototype object is itself an
The initial value of Intl.DurationFormat.prototype.constructor
is the intrinsic object
The initial value of the @@toStringTag property is the string value
This property has the attributes { [[Writable]]:
When the format
method is called with an argument duration, the following steps are taken:
When the formatToParts
method is called with an argument duration, the following steps are taken:
This function provides access to the locale and options computed during initialization of the object.
Internal Slot | Property |
---|---|
[[Locale]] | |
[[NumberingSystem]] | |
[[Style]] | |
[[YearsStyle]] | |
[[YearsDisplay]] | |
[[MonthsStyle]] | |
[[MonthsDisplay]] | |
[[WeeksStyle]] | |
[[WeeksDisplay]] | |
[[DaysStyle]] | |
[[DaysDisplay]] | |
[[HoursStyle]] | |
[[HoursDisplay]] | |
[[MinutesStyle]] | |
[[MinutesDisplay]] | |
[[SecondsStyle]] | |
[[SecondsDisplay]] | |
[[MillisecondsStyle]] | |
[[MillisecondsDisplay]] | |
[[MicrosecondsStyle]] | |
[[MicrosecondsDisplay]] | |
[[NanosecondsStyle]] | |
[[NanosecondsDisplay]] | |
[[FractionalDigits]] |
Intl.DurationFormat instances inherit properties from
Intl.DurationFormat instances have an [[InitializedDurationFormat]] internal slot.
Intl.DurationFormat instances also have several internal slots that are computed by the
© 2024 Ujjwal Sharma, Younies Mahmoud
All Software contained in this document ("Software") is protected by copyright and is being made available under the "BSD License", included below. This Software may be subject to third party rights (rights from parties other than Ecma International), including patent rights, and no licenses under such third party rights are granted under this license even if the third party concerned is a member of Ecma International. SEE THE ECMA CODE OF CONDUCT IN PATENT MATTERS AVAILABLE AT https://ecma-international.org/memento/codeofconduct.htm FOR INFORMATION REGARDING THE LICENSING OF PATENT CLAIMS THAT ARE REQUIRED TO IMPLEMENT ECMA INTERNATIONAL STANDARDS.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
THIS SOFTWARE IS PROVIDED BY THE ECMA INTERNATIONAL "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL ECMA INTERNATIONAL BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.