Interval.span

Returns an interval that covers from the earliest time point of two intervals up to (but not including) the latest time point of two intervals.

  1. Interval span(Interval interval)
  2. PosInfInterval!TP span(PosInfInterval!TP interval)
    struct Interval(TP)
    const pure
    span
    (
    scope const PosInfInterval!TP interval
    )
  3. NegInfInterval!TP span(NegInfInterval!TP interval)

Parameters

interval PosInfInterval!TP

The interval to create a span together with this interval.

Throws

std.datetime.date.DateTimeException if this interval is empty.

Examples

assert(Interval!Date(Date(1996, 1, 2), Date(2012, 3, 1)).span(
            PosInfInterval!Date(Date(1990, 7, 6))) ==
       PosInfInterval!Date(Date(1990, 7 , 6)));

assert(Interval!Date(Date(1996, 1, 2), Date(2012, 3, 1)).span(
            PosInfInterval!Date(Date(2050, 1, 1))) ==
       PosInfInterval!Date(Date(1996, 1 , 2)));

Meta