Skip to main content

Module duration

Module duration 

Source
Expand description

Durations, in the two forms this tool has to speak.

Tracker takes and returns ISO 8601 durations — PT1H30M. Nobody types that, and nobody wants to read it either, so 1h30m goes in and 1h 30m comes out. The ISO form is still accepted on input: a caller who already has one, or who is scripting against the API’s own vocabulary, should not have to translate it into ours and back.

Functions§

human
Render an ISO 8601 duration the way it was typed: PT1H30M becomes 1h 30m.
to_iso8601
Parse 1h30m, 45m, 2d, 1w, or an ISO 8601 duration, into ISO 8601.