andrewmcveigh / cljs-time

A clj-time inspired date library for clojurescript.
342 stars 57 forks source link

Unparse duration in ISO 8601 format? #141

Open kennyjwilli opened 4 years ago

kennyjwilli commented 4 years ago

It appears the only way to format a duration is using the unparse-duration function which returns a string with an implicit format.

(time-fmt/unparse-duration (time/period :hours 1))
=> "1 hour"

Is there a way to configure the formatting for a duration to output a ISO 8601 string? It uses the format PnYnMnDTnHnMnS for formatting a duration to a string.