Liking cljdoc? Tell your friends :D

periods.core

This namespace focuses entirely on periods. This is not a date/time library.

All period units are plural.

This namespace focuses entirely on periods.
This is not a date/time library.

All period units are plural.
raw docstring

normalizeclj/s

(normalize period)

If a value is outside the normal bounds of a unit, spill over to next unit. e.g. {:hours 25} => {:days 1 :hours 1} {:days 0.5} => {:hours 12} {:hours 1.5} => {:hours 1 :minutes 30} {:hours 1.5 :minutes 30} => {:hours 2}

If a value is outside the normal bounds of a unit, spill over to next unit.
e.g.
{:hours 25} => {:days 1 :hours 1}
{:days 0.5} => {:hours 12}
{:hours 1.5} => {:hours 1 :minutes 30}
{:hours 1.5 :minutes 30} => {:hours 2}
sourceraw docstring

normalize-millisecondsclj/s

(normalize-milliseconds millisecond-period)
source

period->millisecond-periodclj/s

(period->millisecond-period period)

Convert any period to a period with milliseconds

Convert any period to a period with milliseconds
sourceraw docstring

period->mono-periodclj/s

(period->mono-period period target-unit)

Convert any period to a period with one specific unit. If source period has data in smaller periods than target-unit, that data will be dropped.

Convert any period to a period with one specific unit.
If source period has data in smaller periods than `target-unit`,
that data will be dropped.
sourceraw docstring

period-unitsclj/s

source

shrinkclj/s

source

shrinking-multiplierclj/s

source

stringify-periodclj/s

(stringify-period period)
(stringify-period period format-unit)

Not too happy with this API yet. Do not use unless you're willing to deal with breaking changes. reserve the symbol format-period for a future api that makes use of format strings to make usage easier

Not too happy with this API yet. Do not use unless you're willing to deal with breaking changes.
reserve the symbol `format-period` for a future api that makes use of format strings to make usage easier
sourceraw docstring

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close