EveryWeekday class
Class that processes DateTime so that the addWeeks always returns the next week's with the DateTime.weekday equals to the weekday.
- Inheritance
-
- Object
- DateValidatorWeekday
- EveryWeekday
- Implemented types
- Mixed-in types
Constructors
- EveryWeekday(Weekday weekday)
-
Returns a EveryWeekday with the given
weekday. When you call next or previous on this EveryWeekday, it will return theweekdayof the next or previous week.const - EveryWeekday.from(DateTime date)
-
Returns a EveryWeekday with the weekday being the weekday of
the given
date. When you call next or previous on this EveryWeekday, it will return the weekday of the next or previous week.factory
Properties
- hashCode → int
-
The hash code for this object.
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
- stringify → bool?
-
If set to
true, the toString method will be overridden to output this instance's props.no setterinherited - weekday → Weekday
-
The expected weekday.
finalinherited
Methods
-
addMonths(
DateTime date, int months) → DateTime -
Returns a new DateTime where the week is the same(Week) inside the
month and is
monthsmonths from this week and the DateTime.weekday is equal to weekday.override -
addWeeks(
DateTime date, int weeks) → DateTime -
Returns a new DateTime where the week is
weeksfrom this week and the DateTime.weekday is equal to weekday.override -
addYears(
DateTime date, int years) → DateTime -
Returns a new DateTime where the week is the same inside the month and
is
yearsyears from this week and the DateTime.weekday is equal to weekday.override -
compareTo(
DateValidatorWeekday other) → int -
Compares this object to another object.
inherited
-
filterValidDates(
Iterable< DateTime> dates) → Iterable<DateTime> -
Returns the valid dates for this DateValidator in
dates.inherited -
invalid(
DateTime date) → bool -
Returns true if the
dateis invalid for this DateValidator.inherited -
next(
DateTime date) → DateTime -
Returns the previous date that fits the weekday.
override
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
previous(
DateTime date) → DateTime -
Returns the previous date that fits the weekday.
override
-
startDate(
DateTime date) → DateTime -
Returns the next date that fits the weekday.
override
-
toString(
) → String -
A string representation of this object.
override
-
valid(
DateTime date) → bool -
Returns true if the
dateis valid for this DateValidator.inherited -
validsIn(
Iterable< DateTime> dates) → Iterable<DateTime> -
Returns the valid dates for this DateValidator in
dates.inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Constants
-
weekend
→ const EveryDateValidatorUnion<
EveryWeekday> - An EveryDateValidator that generates a DateTime that is a weekend.
-
workdays
→ const EveryDateValidatorUnion<
EveryWeekday> - An EveryDateValidator that generates a DateTime that is a workday.