ILibDurationFmt class
Formats a duration (years, months, weeks, days, hours, minutes, seconds, milliseconds) as a localized string.
Configure with ILibDurationFmtOptions and call format with an
ILibDateOptions that carries the duration components. The formatter is
immutable once created. Two styles are supported: 'text' (all units) and
'clock' (large units as text + small units as a clock time such as
1:23:45).
Constructors
- ILibDurationFmt(ILibDurationFmtOptions options)
-
Create a formatter from
options. Unspecified options fall back to the locale's defaults.
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
format(
ILibDateOptions components) → String - Format a duration according to this formatter's style/length.
-
getLength(
) → String -
The length setting (
'short','medium','long', or'full'). -
getLocale(
) → String - The BCP-47 locale this formatter was configured with.
-
getStyle(
) → String -
The style setting (
'text'or'clock'). -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited