Dates extension
Provides low-level functions for working with dates.
These functions should only be used when it is not feasible to use sugar.time, such as when working with 3rd-party
date-time types.
- on
-
- Never
Static Methods
-
dayOfYear(
int year, int month, int day) → int -
Available on Never, provided by the Dates extension
Computes the ordinal day of the year. -
daysInMonth(
int year, int month) → int -
Available on Never, provided by the Dates extension
Computes the number of days in the given month taking leap years into account. -
format(
int year, [int month = 1, int day = 1]) → String -
Available on Never, provided by the Dates extension
Formats the date as a ISO-8601 date. -
leapYear(
int year) → bool -
Available on Never, provided by the Dates extension
Returns true if theyearis a leap year. -
weekday(
int year, int month, int day) → int -
Available on Never, provided by the Dates extension
Computes the ordinal day of the week. -
weekOfYear(
int year, int month, int day) → int -
Available on Never, provided by the Dates extension
Computes the ordinal week of the year.
Constants
-
leapYearMonths
→ const List<
int> - The months in a leap year.
-
nonLeapYearMonths
→ const List<
int> - The months in a non-leap year.