Liking cljdoc? Tell your friends :D

duckling.time.pred


composeclj

(compose pred)
(compose pred1' pred2')
(compose pred1 pred2 & more)

Compose several predicates - can see this as intersection

Compose several predicates - can see this as intersection
sourceraw docstring

cycleclj

(cycle grain)

A sequence of each year, or month, or week, etc. Used for 'this year', 'next month', 'last week'..

A sequence of each year, or month, or week, etc.
Used for 'this year', 'next month', 'last week'..
sourceraw docstring

day-of-monthclj

(day-of-month dom)
source

day-of-weekclj

(day-of-week dow)
source

fn&cljmacro

(fn& grain args & forms)
source

grain-after-shiftclj

source

hourclj

(hour h twelve-hour-clock?)
source

intervalsclj

(intervals pred-from pred-to inclusive-to?)

Builds a sequence of intervals, each starting at the start of pred-from and ending at the start (inclusive-to? false) or end (inclusive-to? true) of the first pred-from time that follows the start of pred-from. Example: (intervals (day-of-week 1) (day-of-week 3) true)

Builds a sequence of intervals, each starting at the start of pred-from
and ending at the start (inclusive-to? false) or end (inclusive-to? true)
of the first pred-from time that follows the start of pred-from.
Example: (intervals (day-of-week 1) (day-of-week 3) true)
sourceraw docstring

minuteclj

(minute m)
source

monthclj

(month mo)
source

my-mapcatclj

(my-mapcat f coll)
source

resolveclj

(resolve {:keys [dim pred not-immediate timezone] :as token}
         {:keys [reference-time] :as context})

Turns a token into a list of actual possible time values. Behavior depends on the ref-time in context, and token fields like :not-immediate.

Turns a token into a list of actual possible time values.
Behavior depends on the ref-time in context, and token fields like
:not-immediate.
sourceraw docstring

safe-maxclj

source

safe-max-intervalclj

source

secclj

(sec s)
source

seq-mapclj

(seq-map f pred & [dont-reverse?])

Applies f to each interval yielded by pred. As f changes intervals, an interval that was ahead can become behind, and reciprocally. We make the assumption that f doesn't change the order of intervals though, or it would be much harder to maintain lazyness.

Applies f to each interval yielded by pred.
As f changes intervals, an interval that was ahead can become behind, and
reciprocally. We make the assumption that f doesn't change the order of
intervals though, or it would be much harder to maintain lazyness.
sourceraw docstring

shift-durationclj

(shift-duration base-pred duration)

Shifts base-pred forward or backward ('two days after pred') Duration can be negative ('three hours before pred'). The resulting grain is the one just below the duration's grain Shifted slots' width is exactly their grain

Shifts base-pred forward or backward ('two days after pred')
Duration can be negative ('three hours before pred').
The resulting grain is the one just below the duration's grain
Shifted slots' width is exactly their grain
sourceraw docstring

showclj

(show f)
source

take-nclj

(take-n pred n & [opts])

Takes n cycles of pred. Used for 'next 2 weeks' for instance. Goes forward for positive n, backward otherwise.

Accepts a :not-immediate option like take-the-nth

Takes n cycles of pred. Used for 'next 2 weeks' for instance.
Goes forward for positive n, backward otherwise.

Accepts a :not-immediate option like take-the-nth
sourceraw docstring

take-the-last-ofclj

(take-the-last-of cyclic-pred base-pred)

Takes the last occurence of cyclic-pred within base-pred. For example, cyclic-pred is 'Monday' and base-pred 'October'

Takes the *last* occurence of cyclic-pred *within* base-pred.
For example, cyclic-pred is 'Monday' and base-pred 'October'
sourceraw docstring

take-the-nthclj

(take-the-nth pred n & [opts])

Builds a predicate with only the nth time slot of a presumably cyclical pred after ref-time, backward (negative n) or forward (positive n). Beware that 0 => first forward, but -1 => first backward

Options:

:not-immediate: if true, the first slot will be dropped if it contains t. No effect on backward lookups (t is never containes in them).

Builds a predicate with only the nth time slot of a presumably cyclical pred after ref-time,
backward (negative n) or forward (positive n).
Beware that 0 => first forward, but -1 => first backward

Options:

:not-immediate: if true, the first slot will be dropped if it
contains t. No effect on backward lookups (t is never containes in them).
sourceraw docstring

take-the-nth-afterclj

(take-the-nth-after cyclic-pred base-pred n & [opts])

Like take-the-nth, but takes the nth cyclic-pred after base-pred (or before if n is negative. Since pred generates sequences, it also generates sequences.

Options: :not-immediate works as usual

Like take-the-nth, but takes the nth cyclic-pred *after base-pred*
(or before if n is negative.
Since pred generates sequences, it also generates sequences.

Options: :not-immediate works as usual
sourceraw docstring

yearclj

(year yyyy)
source

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

× close