InternalDateTimeRange class
A DateTimeRange that uses InternalDateTime for timezone-safe display and layout.
Both start and end are stored as InternalDateTime values, so all helpers on this range (dates, overlaps, week numbers, etc.) are DST-safe. Use forLocation to convert back to wall-clock DateTimeRange.
- Inheritance
-
- Object
- DateTimeRange<
InternalDateTime> - InternalDateTimeRange
Constructors
- InternalDateTimeRange({required DateTime start, required DateTime end})
- Creates a InternalDateTimeRange instance.
-
InternalDateTimeRange.fromDateTimeRange(DateTimeRange<
DateTime> dateTimeRange) - Creates a InternalDateTimeRange from an existing DateTimeRange.
Properties
- dominantMonthDate → DateTime
-
The first day of the month that contains the most days in this range.
no setter
- duration → Duration
-
Returns a Duration of the time between start and end.
no setterinherited
- end → InternalDateTime
-
The end of the range of dates.
finalinherited
- hashCode → int
-
The hash code for this object.
no setterinherited
- monthDifference → int
-
The number of calendar months between start and end.
no setter
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- start → InternalDateTime
-
The start of the range of dates.
finalinherited
- weekNumbers → (int, int?)
-
The ISO 8601 week number(s) this range spans.
no setter
Methods
-
dates(
{bool inclusive = false}) → List< InternalDateTime> - Returns the list of calendar dates covered by this range (at midnight each).
-
dateTimeRangeOnDate(
InternalDateTime date) → InternalDateTimeRange? -
Returns the sub-range of this range that falls on
date, ornullifdateis outside the range. -
forLocation(
{Location? location}) → DateTimeRange< DateTime> -
Converts to a wall-clock DateTimeRange in the given
location(or local ifnull). -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
overlaps(
DateTimeRange< DateTime> other, {bool touching = false}) → bool -
Whether this range shares any time with
other. -
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited