model/date/date library

Contains date-related models.

Classes

Date
A calendar date. Year / month / day.
DatepickerSelection
Represents something that might be chosen by some hypothetical date picker component.
DateRange
A date range with a start and end, inclusive. null values for either means the range is unbounded in that direction.
DateRangeComparison
A date range and an optional comparison date range.

Functions

daysSpanned(Date start, Date end, {bool inclusive = true}) int
The number of days spanned by the range defined by the two dates. Defaults to including the end date, so that daysSpanned(d, d) == 1.
earlierOf(Date a, Date b) Date
Gets the earlier of the two given dates.
enumerateDates(Date start, Date end) Iterable<Date>
Enumerates all dates from start to end, inclusive.
enumerateRange(DateRange range) Iterable<Date>
Enumerates all dates from range.start to range.end, inclusive.
laterOf(Date a, Date b) Date
Gets the later of the two given dates.
rangeContains(DateRange range, Date date) bool
Whether or not date is inside range.
rangeContainsRange(DateRange range, DateRange subrange) bool
Whether or not subrange is fully contained by range.