Interval.expand

void expand(D)(D duration, Direction dir = Direction.both) if (__traits(compiles, begin + duration)) pure

Expands the interval forwards and/or backwards in time. Effectively, it does begin -= duration and/or end += duration. Whether it expands forwards and/or backwards in time is determined by

dir.

Parameters

durationThe duration to expand the interval by.
dirThe direction in time to expand the interval.

Throws

DateTimeException this interval is empty

or if the resulting interval would be invalid.

Example: -------------------- auto interval1 = Interval!Date(Date(1996, 1, 2), Date(2012, 3, 1)); auto interval2 = Interval!Date(Date(1996, 1, 2), Date(2012, 3, 1));

interval1.expand(2); assert(interval1 == Interval!Date(Date(1994, 1, 2), Date(2014, 3, 1)));

interval2.expand(-2); assert(interval2 == Interval!Date(Date(1998, 1, 2), Date(2010, 3, 1))); --------------------