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
the weekday of 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
months
months 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
weeks
from 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
years
years 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
date
is 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
date
is 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.