DateInterval constructor
Constructs a date interval from a start date and an end date, both of which are included in the interval.
start: Start date of the intervalend: End date of the interval
Returns: A date interval between the specified dates.
- ArgumentError:
endis earlier thanstartor the two dates are in different calendars.
Implementation
DateInterval(this.start, this.end) {
// todo: will this equivalence work out?
Preconditions.checkArgument(start.calendar == end.calendar, 'end',
"Calendars of start and end dates must be the same.");
Preconditions.checkArgument(!(end < start), 'end',
"End date must not be earlier than the start date");
}