EveryWeekdayCountInMonth class
Class that processes DateTime so that the addMonths always returns the next month's with the week occurrence of the day (DateTime.weekday is the day's Weekday.dateTimeValue).
E.g.:
const firstMonday = EveryDayOfWeek(day: Weekday.monday, week: Week.first);
firstMonday.addMonths(DateTime(2020, 1, 1), 1); // DateTime(2020, 2, 3).
const lastFriday = EveryDayOfWeek(day: Weekday.friday, week: Week.last);
lastFriday.addMonths(DateTime(2020, 1, 1), 1); // DateTime(2020, 2, 28).
- Inheritance
-
- Object
- DateValidatorWeekdayCountInMonth
- EveryWeekdayCountInMonth
- Mixed-in types
Constructors
- EveryWeekdayCountInMonth({required Week week, required Weekday day})
-
Class that processes DateTime so that the addMonths always returns the
next month's with the week occurrence of the day (DateTime.weekday
is the day's Weekday.dateTimeValue).
const
- EveryWeekdayCountInMonth.from(DateTime date)
-
Returns a EveryWeekdayCountInMonth with the given day and week from
the given
date.factory
Properties
- day → Weekday
-
The expected day of the week.
finalinherited
- 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 - week → Week
-
The expected week of the month.
finalinherited
Methods
-
addMonths(
DateTime date, int months) → DateTime -
Returns the
date- DateTime.month +monthswith the week occurrence of the day.override -
addYears(
DateTime date, int years) → DateTime -
This mixin's implementation of Every.next and Every.previous.
override
-
compareTo(
DateValidatorWeekdayCountInMonth other) → int -
Compares this object to another object.
inherited
-
endDate(
DateTime date) → DateTime -
Returns the previous DateTime that matches the Every pattern.
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 next date that fits the day and the week.
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 day and the week.
override
-
startDate(
DateTime date) → DateTime -
Returns the start date considering the given
everybase process. Ifeveryis a LimitedEveryDateValidator, thelimitwill be passed on.inherited -
toString(
) → String -
A string representation of this object.
override
-
valid(
DateTime date) → bool -
Returns true if the
dateis valid for this DateValidator.inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
override
-
operator unary-(
) → DateValidator -
inherited