(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
(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'..
(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)
(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.
(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.
(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
(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
(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'
(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).
(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
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close