Liking cljdoc? Tell your friends :D

java-time.interval


abuts?

(abuts? i oi)

True if this interval abut with the other one

True if this interval abut with the other one
sourceraw docstring

contains?

(contains? i o)

True if the interval contains the given instant or interval

True if the interval contains the given instant or interval
sourceraw docstring

end

(end i)

Gets the end instant of the interval

Gets the end instant of the interval
sourceraw docstring

gap

(gap i oi)

Gets the gap between this interval and the other one or nil

Gets the gap between this interval and the other one or `nil`
sourceraw docstring

interval

(interval o)
(interval a b)

Constructs an interval out of a string, start and end instants or a start

  • duration:

(j/interval "2010-01-01T00:00:00Z/2013-01-01T00:00:00Z") => #<Interval 2010-01-01T00:00:00Z/2013-01-01T00:00:00Z>

(j/interval (j/instant 100000) (j/instant 1000000)) => #<Interval 1970-01-01T00:01:40Z/1970-01-01T00:16:40Z>

(j/interval (j/instant 100000) (j/duration 15 :minutes)) => #<Interval 1970-01-01T00:01:40Z/1970-01-01T00:16:40Z>

Constructs an interval out of a string, start and end instants or a start
+ duration:

(j/interval "2010-01-01T00:00:00Z/2013-01-01T00:00:00Z")
=> #<Interval 2010-01-01T00:00:00Z/2013-01-01T00:00:00Z>

(j/interval (j/instant 100000) (j/instant 1000000))
=> #<Interval 1970-01-01T00:01:40Z/1970-01-01T00:16:40Z>

(j/interval (j/instant 100000) (j/duration 15 :minutes))
=> #<Interval 1970-01-01T00:01:40Z/1970-01-01T00:16:40Z>
sourceraw docstring

interval?

(interval? o)

True if Interval

True if `Interval`
sourceraw docstring

move-end-by

(move-end-by i & os)

Moves the end instant of the interval by the sum of given periods/durations/numbers of milliseconds.

(move-start-by (interval 0 10000) (millis 1000) (seconds 1)) => #<Interval ...:00Z/...:12Z>

Fails if the new end instant falls before the start instant.

(move-end-by (interval 0 10000) (millis -11000)) => DateTimeException...

Moves the end instant of the interval by the sum of given
periods/durations/numbers of milliseconds.

  (move-start-by (interval 0 10000) (millis 1000) (seconds 1))
  => #<Interval ...:00Z/...:12Z>

Fails if the new end instant falls before the start instant.

  (move-end-by (interval 0 10000) (millis -11000))
  => DateTimeException...
sourceraw docstring

move-end-to

(move-end-to i new-end)

Moves the end of the interval to the given instant (or something convertible to an instant):

(move-end-to (interval 0 10000) (instant 15000)) => #<Interval ...:00Z/...:15Z>

Fails if the new end instant falls before the start instant:

(move-end-to (interval 0 10000) (millis -1)) => DateTimeException...

Moves the end of the interval to the given instant (or something
 convertible to an instant):

 (move-end-to (interval 0 10000) (instant 15000))
 => #<Interval ...:00Z/...:15Z>

Fails if the new end instant falls before the start instant:

 (move-end-to (interval 0 10000) (millis -1))
 => DateTimeException...
sourceraw docstring

move-start-by

(move-start-by i & os)

Moves the start instant of the interval by the sum of given periods/durations/numbers of milliseconds:

(move-start-by (interval 0 10000) (millis 1000) (seconds 1)) => #<Interval ...:02Z/...:10Z>

Fails if the new start instant falls after the end instant.

(move-start-by (interval 0 10000) (millis 11000)) ; => DateTimeException...

Moves the start instant of the interval by the sum of given
periods/durations/numbers of milliseconds:

  (move-start-by (interval 0 10000) (millis 1000) (seconds 1))
  => #<Interval ...:02Z/...:10Z>

Fails if the new start instant falls after the end instant.

  (move-start-by (interval 0 10000) (millis 11000))
  ; => DateTimeException...
sourceraw docstring

move-start-to

(move-start-to i new-start)

Moves the start instant of the interval to the given instant (or something convertible to an instant):

(move-start-to (interval 0 10000) (instant 5000)) => #<Interval ...:05Z/...:10Z>

Fails if the new start instant falls after the end instant:

(move-start-to (interval 0 10000) (millis 15000)) => DateTimeException...

Moves the start instant of the interval to the given instant (or something
 convertible to an instant):

 (move-start-to (interval 0 10000) (instant 5000))
 => #<Interval ...:05Z/...:10Z>

Fails if the new start instant falls after the end instant:

 (move-start-to (interval 0 10000) (millis 15000))
 => DateTimeException...
sourceraw docstring

overlap

(overlap i oi)

Gets the overlap between this interval and the other one or nil

Gets the overlap between this interval and the other one or `nil`
sourceraw docstring

overlaps?

(overlaps? i oi)

True if this interval overlaps the other one

True if this interval overlaps the other one
sourceraw docstring

seq-move-end-by

(seq-move-end-by i os)

Use move-end-by with vararags

Use `move-end-by` with vararags
sourceraw docstring

seq-move-start-by

(seq-move-start-by i os)

Use move-start-by with vararags

Use `move-start-by` with vararags
sourceraw docstring

start

(start i)

Gets the start instant of the interval

Gets the start instant of the interval
sourceraw docstring

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

× close