Timespan class

Constructors

Timespan({DateTime? begin, DateTime? end, Duration? duration})
Timespan.arround(DateTime time, Duration delta)
Get a symmetric Timespan arround the given time with delta as the difference of begin and end from time thus the duration of the timespan is 2 * delta
factory
Timespan.empty()
factory
Timespan.today({int daysAgo = 0})
Get Timespan of a day. if daysAgo is zero, the end of the timespan is DateTime.now()
factory

Properties

begin DateTime
getter/setter pair
duration Duration
getter/setter pair
end DateTime
getter/setter pair
hashCode int
The hash code for this object.
no setteroverride
month Iterable<Timespan>
get all month that overlap with a the Timespan
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
weeks Iterable<Timespan>
get all weeks that overlap with a the Timespan
no setter
years Iterable<Timespan>
get all years that overlap with a the Timespan
no setter

Methods

cut(DateTime time) List<Timespan>
Returns a list of two Timespans. If time is not in this it throws an error
includes(DateTime time) bool
intersection(Timespan other) Timespan
intersects(Timespan other) bool
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
override
update({DateTime? begin, DateTime? end, Duration? duration}) → void
The update function handles not only the updates to an existing Timespan but also acts as a quasi constructor. Since all parameters are optional the default behaviour is explained in the update-function itself.

Operators

operator ==(Object other) bool
The equality operator.
override