CalendarDateUtils class

Utility methods for date calculations used throughout the calendar.

All methods are static. This class cannot be instantiated.

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

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 other) bool
The equality operator.
inherited

Static Methods

dateOnly(DateTime date) DateTime
Strips the time component, returning midnight on the same date.
daysInMonth(int year, int month) int
Returns the number of days in the given month of year.
daysInMonthGrid(DateTime month, {int firstDayOfWeek = 1}) List<DateTime>
Returns 42 dates (6 weeks) for a month grid view, including leading and trailing days from adjacent months to fill the grid.
daysInWeek(DateTime date, {int startOfWeek = 1}) List<DateTime>
Returns the 7 dates of the week containing date.
firstDayOfMonth(DateTime date) DateTime
Returns the first day of the month containing date.
firstDayOfWeek(DateTime date, {int firstDay = 1}) DateTime
Returns the first day of the week containing date.
isSameDay(DateTime a, DateTime b) bool
Returns true if a and b fall on the same calendar day.
isSameMonth(DateTime a, DateTime b) bool
Returns true if a and b are in the same year and month.
lastDayOfMonth(DateTime date) DateTime
Returns the last day of the month containing date.
monthName(int month) String
Returns the Chinese name for the given month (1-12).
weekdayName(int weekday, {bool short = true}) String
Returns the Chinese weekday name for weekday (1 = Monday, 7 = Sunday).
weekNumber(DateTime date) int
Returns the ISO week number for the given date.