YearMonth class
- Implemented types
Constructors
- YearMonth(int year, int month)
-
Create new YearMonth's year and month with valid value
const
- YearMonth.dateTime(DateTime dateTime)
-
Inspect DateTime object and convert back to YearMonth
factory
- YearMonth.now()
-
Get current year and month from DateTime.now
factory
Properties
-
allDaysInMonth
→ Set<
DateTime> -
Generate a Set of
DateTime
which is from YearMonthno setter - firstDay → DateTime
-
Get first day of YearMonth and convert back to YearMonth
no setter
- hashCode → int
-
Hash code from
Obejct.hashCode
, but not design for using ==.no setteroverride - lastDay → DateTime
-
Get last day of YearMonth and convert back to YearMonth
no setter
- month → int
-
Month between
1
to12
final - runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- todayInThisMonth → bool
-
Check today is contains in this month from YearMonth.now
no setter
- year → int
-
Year which follow ISO 8601
standard of the year format
final
Methods
-
compareTo(
YearMonth other) → int -
Implemented from Comparable which equal
0
means this andother
are the same, greater than0
meansother
is greater and lesser than0
meansother
is lesseroverride -
formatString(
{String format = "MMMM, yyyy", String? locale}) → String -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator <(
Object compare) → bool -
Compare this YearMonth is lesser than
compare
-
operator <=(
Object compare) → bool - Combine operator of == and <
-
operator ==(
Object compare) → bool -
Compare this YearMonth and
compare
the sameoverride -
operator >(
Object compare) → bool -
Compare this YearMonth is greater than
compare
-
operator >=(
Object compare) → bool - Combine operator of == and >