Return the duration in a set of whole numbered time components, ordered from largest to smallest
Only components != 0 will be returned.
Can combine millis and seconds together for the benefit of toIsoString, makes the logic in there simpler.
Returns stringified number of duration.
Checks if duration is a token or a resolvable object.
Return the total number of days in this Duration.
the value of this Duration
expressed in Days.
Return the total number of hours in this Duration.
the value of this Duration
expressed in Hours.
Turn this duration into a human-readable string.
(deprecated) Return an ISO 8601 representation of this period.
a string starting with 'P' describing the period
Return an ISO 8601 representation of this period.
a string starting with 'P' describing the period
Return the total number of milliseconds in this Duration.
the value of this Duration
expressed in Milliseconds.
Return the total number of minutes in this Duration.
the value of this Duration
expressed in Minutes.
Return the total number of seconds in this Duration.
the value of this Duration
expressed in Seconds.
Returns a string representation of this Duration
that is also a Token that cannot be successfully resolved.
This
protects users against inadvertently stringifying a Duration
object, when they should have called one of the
to*
methods instead.
Returns unit of the duration.
Create a Duration representing an amount of days.
the amount of Days the Duration
will represent.
a new Duration
representing amount
Days.
Create a Duration representing an amount of hours.
the amount of Hours the Duration
will represent.
a new Duration
representing amount
Hours.
Create a Duration representing an amount of milliseconds.
the amount of Milliseconds the Duration
will represent.
a new Duration
representing amount
ms.
Create a Duration representing an amount of minutes.
the amount of Minutes the Duration
will represent.
a new Duration
representing amount
Minutes.
Parse a period formatted according to the ISO 8601 standard.
an ISO-formtted duration to be parsed.
the parsed Duration
.
Create a Duration representing an amount of seconds.
the amount of Seconds the Duration
will represent.
a new Duration
representing amount
Seconds.
Generated using TypeDoc
Represents a length of time.
The amount can be specified either as a literal value (e.g:
10
) which cannot be negative, or as an unresolved number token.When the amount is passed as a token, unit conversion is not possible.
stable