DateRange

An implementation of a ForwardRange for dates.

Disabled Default Constructor

A disabled default is present on this object. To use it, use one of the other constructors or a factory function.

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
1 auto Feb2016 = DateRange(2,2016);
2 
3 assert(Feb2016.days == 29);
4 
5 Feb2016.popFront();
6 assert(Feb2016.front == mkDate(2, 2, 2016));

Meta