DayPeriodBundle class abstract
A base class that represents a bundle of days.
- Inheritance
- Implementers
Constructors
- DayPeriodBundle.new({required DateTime start, required DateTime end})
- A base class that represents a bundle of days.
Properties
-
days
→ List<
DayPeriod> -
Returns the list of days in this bundle.
no setter
- duration → Duration
-
The difference between the start and end plus one microsecond.
If start and end are equal, returns
Duration(microseconds: 1).no setterinherited - end → DateTime
-
The end of the period. It is included in the period.
finalinherited
- hashCode → int
-
The hash code for this object.
no setterinherited
- isEmpty → bool
-
If start and end are equal.
no setterinherited
- isLocal → bool?
-
If the start and end are both in local time.
no setterinherited
- isNotEmpty → bool
-
If start and end are different.
no setterinherited
- isUtc → bool?
-
If the start and end are both in UTC.
no setterinherited
-
props
→ List<
Object?> -
The list of properties that will be used to determine whether
two instances are equal.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- start → DateTime
-
The start of the period. It is included in the period.
finalinherited
- stringify → bool?
-
If set to
true, the toString method will be overridden to output this instance's props.no setterinherited
Methods
-
compareTo(
Period other) → int -
Compares this object to another object.
inherited
-
containedFullyBy(
Period other) → bool -
Returns
trueif this is contained fully byother.inherited -
containedPartiallyBy(
Period other) → bool -
Returns
trueif this is contained partially byother.inherited -
contains(
DateTime date) → bool -
Returns
trueif this contains the givendate. If thedateis equal to the start or end or is between the two dates, it will returntrue.inherited -
containsFully(
Period other) → bool -
Returns
trueif this fully containsother.inherited -
containsPartially(
Period other) → bool -
Returns
trueif this contains partiallyother.inherited -
copyWith(
{DateTime? start, DateTime? end}) → Period -
Returns a new Period with the given
startandendvalues. Ifstartorendare not provided, the corresponding value of this is used.inherited -
differenceBetween(
Period other) → List< Period> -
Returns a list of Periods that are the difference between this and
other.inherited -
doesNotOverlapWith(
Period other) → bool -
Returns
trueif this does not overlap withother.inherited -
endsAfter(
DateTime date) → bool -
Returns
trueif this ends after the givendate.inherited -
endsBefore(
DateTime date) → bool -
Returns
trueif this ends before the givendate.inherited -
getDateTimeValues(
DateTime? next(DateTime last)) → List< DateTime> -
Returns a list of DateTime values that are contained in this Period.
The
nextfunction is used to calculate the DateTime values for the returned list. Thenextfunction is called with the last DateTime value, or start. Thenextfunction must return a DateTime value that is contained in this Period. Thenextfunction must return a DateTime value that is not after the end value of this Period. When thenextfunction returnsnull, the iteration stops.inherited -
getIntersection(
Period other) → Period? -
Returns a Period that is the intersection of this and
other.inherited -
getNext<
T extends Period> (PeriodGeneratorMixin< T> generator) → T -
Returns a new Period that starts after this using
generator.inherited -
getPrevious<
T extends Period> (PeriodGeneratorMixin< T> generator) → T -
Returns a new Period that starts before this using
generator.inherited -
mergeWith(
Period other) → Period? -
Returns a Period that is the union of this and
other.inherited -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
occursAfter(
Period other) → bool -
Returns
trueif this occurs afterother.inherited -
occursBefore(
Period other) → bool -
Returns
trueif this occurs beforeother.inherited -
overlapsWith(
Period other) → bool -
Returns
trueif this overlaps withother.inherited -
shift(
Duration duration) → Period -
Returns a new Period that is shifted by the given
duration.inherited -
splitAt(
Set< DateTime> dates, {Duration periodBetween = Duration.zero}) → List<Period> -
Splits the period in multiple periods at the given
dates. TheperiodBetweenis the duration between each period. Thedatesnot included in the period are ignored. Thedateswill be sorted before splitting. Ifdatescontain the start or end of the period, they will be ignored since they are already included in the period.inherited -
splitIn(
int times, {Duration periodBetween = Duration.zero}) → List< Period> -
Split the period in multiple periods. The
timesis the number of periods to split the period in.inherited -
startsAfter(
DateTime date) → bool -
Returns
trueif this starts after the givendate.inherited -
startsBefore(
DateTime date) → bool -
Returns
trueif this starts before the givendate.inherited -
subtract(
List< Period> periods) → List<Period> -
Returns a list of Periods that are the difference between this Period
and the
periodspassed as argument.inherited -
toLocal(
) → Period -
Returns a Period with the start and end in local time.
inherited
-
toString(
{String dateFormat(DateTime date)?}) → String -
A string representation of this object.
inherited
-
toUtc(
) → Period -
Returns a Period with the start and end in UTC.
inherited
-
trim(
List< Period> periods) → List<Period> -
Removes periods that do not overlap with this period and trims the ones
that do overlap and are not fully contained by this period.
inherited
Operators
-
operator &(
Period other) → Period? -
Returns a Period that is the intersection of this and
other.inherited -
operator <<(
Duration duration) → Period -
Returns a new Period that is shifted by the given
durationbackwards.inherited -
operator ==(
Object other) → bool -
The equality operator.
inherited
-
operator >>(
Duration duration) → Period -
Returns a new Period that is shifted by the given
durationforwards.inherited -
operator |(
Period other) → List< Period> -
Returns a list of Periods.
inherited