DateInterval constructor
Constructs a date interval from a start date and an end date, both of which are included in the interval.
Returns: A date interval between the specified dates.
- ArgumentError: end is earlier than start or 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");
}