Liking cljdoc? Tell your friends :D

joda-time.interval


abuts?clj

(abuts? i oi)

True if this interval abut with the other one.

True if this interval abut with the other one.
raw docstring

contains?clj

(contains? i o)

True if the interval contains the given instant/partial/interval.

True if the interval contains the given
instant/partial/interval.
raw docstring

endclj

(end i)

Gets the end of the interval.

Gets the end of the interval.
raw docstring

gapclj

(gap i oi)

Gets the gap between this interval and the other one.

Gets the gap between this interval and the other one.
raw docstring

intervalclj

(interval o)
(interval start end)

Constructs an interval out of another interval, a string, start and end instants/date-times or a map with the following keys (where start/end may be instants, date-times or number of milliseconds):

  • start/end

  • start/period

  • period/end

  • start/duration

  • duration/end

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

    (j/interval (j/date-time "2010") (j/date-time "2013")) => #<Interval 2010-01-01T00:00:00.000+02:00/2013-01-01T00:00:00.000+02:00>

    (j/interval {:start (j/date-time "2010"), :end (j/date-time "2013")}) => #<Interval 2010-01-01T00:00:00.000+02:00/2013-01-01T00:00:00.000+02:00>

    (j/interval {:start (j/date-time "2010"), :period (j/years 3)}) => #<Interval 2010-01-01T00:00:00.000+02:00/2013-01-01T00:00:00.000+02:00>

Constructs an interval out of another interval, a string,
start and end instants/date-times or a map with the
following keys (where start/end may be instants, date-times
or number of milliseconds):

* start/end
* start/period
* period/end
* start/duration
* duration/end

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

  (j/interval (j/date-time "2010") (j/date-time "2013"))
  => #<Interval 2010-01-01T00:00:00.000+02:00/2013-01-01T00:00:00.000+02:00>

  (j/interval {:start (j/date-time "2010"), :end (j/date-time "2013")})
  => #<Interval 2010-01-01T00:00:00.000+02:00/2013-01-01T00:00:00.000+02:00>

  (j/interval {:start (j/date-time "2010"), :period (j/years 3)})
  => #<Interval 2010-01-01T00:00:00.000+02:00/2013-01-01T00:00:00.000+02:00>
raw docstring

mk-intervalclj

(mk-interval x y)

move-end-byclj

(move-end-by i & os)

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

(move-end-by (interval 0 10000) 3000 (duration 1000) (seconds 1)) => #<Interval 00.000/15.000>

Accepts negative values:

(move-end-by (interval 0 10000) -5000) => #<Interval 00.000/05.000>

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

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

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

  (move-end-by (interval 0 10000) 3000 (duration 1000) (seconds 1))
  => #<Interval 00.000/15.000>

Accepts negative values:

  (move-end-by (interval 0 10000) -5000)
  => #<Interval 00.000/05.000>

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

  (move-end-by (interval 0 10000) -11000)
  => IllegalArgumentException...
raw docstring

move-end-toclj

(move-end-to i new-end)

Moves the end of the interval to the given instant/partial.

(move-end-to (interval 0 10000) (instant 15000)) => #<Interval 00.000/15.000>

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

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

Moves the end of the interval to the given instant/partial.

 (move-end-to (interval 0 10000) (instant 15000))
 => #<Interval 00.000/15.000>

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

 (move-end-to (interval 0 10000) -1)
 => IllegalArgumentException...
raw docstring

move-start-byclj

(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) 3000 (duration 1000) (seconds 1)) => #<Interval 05.000/10.000>

Accepts negative values:

(move-start-by (interval 0 10000) -5000) => #<Interval 00.000/10.000>

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

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

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

  (move-start-by (interval 0 10000) 3000 (duration 1000) (seconds 1))
  => #<Interval 05.000/10.000>

Accepts negative values:

  (move-start-by (interval 0 10000) -5000)
  => #<Interval 00.000/10.000>

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

  (move-start-by (interval 0 10000) 11000)
  ; => IllegalArgumentException...
raw docstring

move-start-toclj

(move-start-to i new-start)

Moves the start instant of the interval to the given instant.

(move-start-to (interval 0 10000) (instant 5000)) => #<Interval 05.000/10.000>

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

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

Moves the start instant of the interval to the given instant.

 (move-start-to (interval 0 10000) (instant 5000))
 => #<Interval 05.000/10.000>

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

 (move-start-to (interval 0 10000) 15000)
 => IllegalArgumentException...
raw docstring

overlapclj

(overlap i oi)

Gets the overlap between this interval and the other one.

Gets the overlap between this interval and the other one.
raw docstring

overlaps?clj

(overlaps? i oi)

True if this interval overlaps the other one.

True if this interval overlaps the other one.
raw docstring

partial-intervalclj

(partial-interval o)
(partial-interval start end)

Constructs an interval from two partials or a map containing:

  • start and end keys
  • start and a period
  • end and a period

Partials must have equal type (contain an equal set of DateTimeFieldTypes) and be contiguous:

(partial-interval (local-date "2010-01-01") (local-date "2011-02-01"))

Intervals are inclusive of the start partial and exclusive of the end partial.

Constructs an interval from two partials or a map containing:

* start and end keys
* start and a period
* end and a period

Partials must have equal type (contain an equal set of
DateTimeFieldTypes) and be contiguous:

  (partial-interval (local-date "2010-01-01")
                    (local-date "2011-02-01"))

Intervals are inclusive of the start partial and exclusive of the end
partial.
raw docstring

partial-interval?clj

(partial-interval? x)

True if the given object is an instance of PartialInterval.

True if the given object is an instance of `PartialInterval`.
raw docstring

seq-move-end-byclj

(seq-move-end-by i os)

Prefer move-end-by with vararags.

Prefer `move-end-by` with vararags.
raw docstring

seq-move-start-byclj

(seq-move-start-by i os)

Prefer move-start-by with vararags.

Prefer `move-start-by` with vararags.
raw docstring

startclj

(start i)

Gets the start of the interval.

Gets the start of the interval.
raw docstring

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

× close