xtr.duration¶
The duration module leverages the ISO-8601 duration format.
of¶
of(parts: Object[Number]): String
Returns the ISO-8601 duration of the given parts
, an Object
of the form:
where all elements are optional.
Example
local parts = {
years: 20, months: 3, days: 1,
hours: 12, minutes: 30, seconds: 45
};
xtr.duration.of(parts)
toParts¶
toParts(duration: String): Object[Number]
Returns the constituent parts of the given duration
, as an Object
of the form:
Example
Result