Utilities for working with time
Utilities for working with time
(divisible? a b)
Returns whether duration a
is evenly divisible by b
.
Returns whether duration `a` is evenly divisible by `b`.
(ensure-chronological)
(ensure-chronological f)
(ensure-chronological coll)
(ensure-chronological f coll)
(ensure-chronological & args)
Return a stateful transducer which will ensure that items that items are emitted in chronological order. Items that happen after the latest will be filtered.
Optionally takes a f
that will be used to access the time field. Usually a keyword if specified.
If called with a collection, will return a sequence of the transducer applied to the collection.
Return a stateful transducer which will ensure that items that items are emitted in chronological order. Items that happen after the latest will be filtered. Optionally takes a `f` that will be used to access the time field. Usually a keyword if specified. If called with a collection, will return a sequence of the transducer applied to the collection.
(round-to time duration)
Returns time
rounded down to an evenly divisible multiple of duration
.
Automatically truncates to milliseconds.
Returns `time` rounded down to an evenly divisible multiple of `duration`. Automatically truncates to milliseconds.
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close