DateX extension

Date utilities as extensions on DateTime.

on

Properties

age → int

Available on DateTime, provided by the DateX extension

Age in full years.
no setter
endOfDay → DateTime

Available on DateTime, provided by the DateX extension

Copy of this date at 23:59:59.999.
no setter
endOfMonth → DateTime

Available on DateTime, provided by the DateX extension

Copy of this date at the end of its month.
no setter
endOfWeek → DateTime

Available on DateTime, provided by the DateX extension

Last day of the week containing this date (Sunday-last).
no setter
formatDate → String

Available on DateTime, provided by the DateX extension

Short date, e.g. Aug 3, 2026.
no setter
formatDateTime → String

Available on DateTime, provided by the DateX extension

Date + time, e.g. Aug 3, 2026, 10:30 AM.
no setter
formatTime → String

Available on DateTime, provided by the DateX extension

Short time, e.g. 10:30 AM.
no setter
formatYear → String

Available on DateTime, provided by the DateX extension

Year only.
no setter
isToday → bool

Available on DateTime, provided by the DateX extension

Whether this date is today.
no setter
isTomorrow → bool

Available on DateTime, provided by the DateX extension

Whether this date is tomorrow.
no setter
isYesterday → bool

Available on DateTime, provided by the DateX extension

Whether this date is yesterday.
no setter
monthName → String

Available on DateTime, provided by the DateX extension

Month name, e.g. August.
no setter
monthNameShort → String

Available on DateTime, provided by the DateX extension

Short month name, e.g. Aug.
no setter
startOfDay → DateTime

Available on DateTime, provided by the DateX extension

Copy of this date at 00:00:00.
no setter
startOfMonth → DateTime

Available on DateTime, provided by the DateX extension

Copy of this date at the start of its month.
no setter
startOfWeek → DateTime

Available on DateTime, provided by the DateX extension

First day of the week containing this date (Monday-first).
no setter
toIsoDate → String

Available on DateTime, provided by the DateX extension

ISO 8601 string, e.g. 2026-08-03.
no setter
weekdayName → String

Available on DateTime, provided by the DateX extension

Weekday name, e.g. Monday.
no setter
weekdayNameShort → String

Available on DateTime, provided by the DateX extension

Short weekday name, e.g. Mon.
no setter

Methods

daysUntil(DateTime other) → int

Available on DateTime, provided by the DateX extension

Whole days between this date and other (other - this).
format(String pattern, {String? locale}) → String

Available on DateTime, provided by the DateX extension

Formats using an intl pattern and optional locale.
isAfterDay(DateTime other) → bool

Available on DateTime, provided by the DateX extension

Whether this date is after other ignoring time.
isBeforeDay(DateTime other) → bool

Available on DateTime, provided by the DateX extension

Whether this date is before other ignoring time.
isInRange(DateTimeRange<DateTime> range) → bool

Available on DateTime, provided by the DateX extension

Whether this date falls inside range.
isSameDay(DateTime other) → bool

Available on DateTime, provided by the DateX extension

Whether other falls on the same calendar day.