ChronoDateTime extension
Calendar helpers available on every DateTime.
- on
Properties
- dateOnly → DateTime
-
Available on DateTime, provided by the ChronoDateTime extension
Midnight at the start of this day, same zone kind.no setter - dayOfYear → int
-
Available on DateTime, provided by the ChronoDateTime extension
Day of the year, 1 to 366.no setter - daysInThisMonth → int
-
Available on DateTime, provided by the ChronoDateTime extension
Number of days in this month.no setter - endOfDay → DateTime
-
Available on DateTime, provided by the ChronoDateTime extension
The last microsecond of this day.no setter - endOfMonth → DateTime
-
Available on DateTime, provided by the ChronoDateTime extension
Last day of this month (at midnight).no setter - endOfQuarter → DateTime
-
Available on DateTime, provided by the ChronoDateTime extension
Last day of this quarter (at midnight).no setter - endOfYear → DateTime
-
Available on DateTime, provided by the ChronoDateTime extension
Last day of this year (at midnight).no setter - isLeap → bool
-
Available on DateTime, provided by the ChronoDateTime extension
Whether this year is a leap year.no setter - isoWeekNumber → int
-
Available on DateTime, provided by the ChronoDateTime extension
ISO-8601 week number (weeks start Monday, week 1 holds the first Thursday of the year).no setter - isoWeekYear → int
-
Available on DateTime, provided by the ChronoDateTime extension
The year that owns isoWeekNumber, which can differ from year in the first and last days of December/January.no setter - isToday → bool
-
Available on DateTime, provided by the ChronoDateTime extension
Whether this is today in the device's local time.no setter - isTomorrow → bool
-
Available on DateTime, provided by the ChronoDateTime extension
Whether this is tomorrow in the device's local time.no setter - isYesterday → bool
-
Available on DateTime, provided by the ChronoDateTime extension
Whether this was yesterday in the device's local time.no setter - quarter → int
-
Available on DateTime, provided by the ChronoDateTime extension
Calendar quarter, 1 to 4.no setter - startOfMonth → DateTime
-
Available on DateTime, provided by the ChronoDateTime extension
First day of this month.no setter - startOfQuarter → DateTime
-
Available on DateTime, provided by the ChronoDateTime extension
First day of this quarter.no setter - startOfYear → DateTime
-
Available on DateTime, provided by the ChronoDateTime extension
First day of this year.no setter
Methods
-
addDays(
int days) → DateTime -
Available on DateTime, provided by the ChronoDateTime extension
Addsdayscalendar days, keeping the time of day (DST safe). -
addMonths(
int months) → DateTime -
Available on DateTime, provided by the ChronoDateTime extension
Addsmonthsmonths, clamping the day to the target month's length (Jan 31 + 1 month = Feb 28/29). -
addWeeks(
int weeks) → DateTime -
Available on DateTime, provided by the ChronoDateTime extension
Addsweekscalendar weeks. -
addYears(
int years) → DateTime -
Available on DateTime, provided by the ChronoDateTime extension
Addsyearsyears, clamping Feb 29 to Feb 28 in non-leap years. -
atTime(
int hour, [int minute = 0, int second = 0]) → DateTime -
Available on DateTime, provided by the ChronoDateTime extension
Same calendar date with the time set fromhourandminute. -
clampTo(
DateTime? min, DateTime? max) → DateTime -
Available on DateTime, provided by the ChronoDateTime extension
Clamps this date intomin..max(either may be null). -
copyWith(
{int? year, int? month, int? day, int? hour, int? minute, int? second, int? millisecond, int? microsecond}) → DateTime -
Available on DateTime, provided by the ChronoDateTime extension
Copy with some fields replaced. -
daysUntil(
DateTime other) → int -
Available on DateTime, provided by the ChronoDateTime extension
Whole calendar days from this day toother(negative ifotheris earlier). Time of day and DST are ignored. -
endOfWeek(
[int firstDayOfWeek = DateTime.monday]) → DateTime -
Available on DateTime, provided by the ChronoDateTime extension
Last day of this week (at midnight). -
isBetweenDays(
DateTime start, DateTime end) → bool -
Available on DateTime, provided by the ChronoDateTime extension
Whether this day lies betweenstartandend, both inclusive, ignoring the time of day. -
isSameDay(
DateTime? other) → bool -
Available on DateTime, provided by the ChronoDateTime extension
Whether this andotherfall on the same calendar day. -
isSameDayOrAfter(
DateTime other) → bool -
Available on DateTime, provided by the ChronoDateTime extension
Whether this is the same day asotheror later. -
isSameDayOrBefore(
DateTime other) → bool -
Available on DateTime, provided by the ChronoDateTime extension
Whether this is the same day asotheror earlier. -
isSameMonth(
DateTime? other) → bool -
Available on DateTime, provided by the ChronoDateTime extension
Whether this andotherfall in the same month of the same year. -
isSameYear(
DateTime? other) → bool -
Available on DateTime, provided by the ChronoDateTime extension
Whether this andotherfall in the same year. -
isWeekend(
[Set< int> weekendDays = const {DateTime.saturday, DateTime.sunday}]) → bool -
Available on DateTime, provided by the ChronoDateTime extension
Whether this day is inweekendDays(Saturday and Sunday by default). -
nextWeekday(
int weekday) → DateTime -
Available on DateTime, provided by the ChronoDateTime extension
The next date (strictly after this day) that falls onweekday. -
nthWeekdayOfMonth(
int n, int weekday) → DateTime? -
Available on DateTime, provided by the ChronoDateTime extension
Thenthweekdayof this month; negativencounts from the end (-1is the last). Returns null when it does not exist (5th Monday). -
previousWeekday(
int weekday) → DateTime -
Available on DateTime, provided by the ChronoDateTime extension
The previous date (strictly before this day) that falls onweekday. -
startOfWeek(
[int firstDayOfWeek = DateTime.monday]) → DateTime -
Available on DateTime, provided by the ChronoDateTime extension
First day of this week, where weeks start onfirstDayOfWeek. -
weekOfYear(
{int firstDayOfWeek = DateTime.sunday}) → int -
Available on DateTime, provided by the ChronoDateTime extension
Week number where weeks start onfirstDayOfWeekand week 1 is the week containing January 1st (the US convention when Sunday).