DateRange

An implementation of a ForwardRange for dates.

Constructors

this
this(Date start, Date end)
this(int month, int year)
this(int year)

Constructor

Members

Functions

empty
bool empty()
front
auto front()
popFront
void popFront()
save
auto save()

for Range access

Properties

days
auto days [@property getter]

Returns the number of days in a range

Examples

DateRange(mkDate(20, 3, 2016), mkDate(4, 4, 2016)); //returns the date range between 2016-03-20 and 2016-04-04
DateRange(2, 2016); //return the date range for the Feb. 2016
DateRange(2016); //return the date range for the whole 2016 year
auto Feb2016 = DateRange(2,2016);

assert(Feb2016.days == 29);

Feb2016.popFront();
assert(Feb2016.front == mkDate(2, 2, 2016));

Meta