DateExtension extension
Convenience methods for working with DateTime values.
- on
Properties
- dateOnly → DateTime
-
Available on DateTime, provided by the DateExtension extension
Returns a DateTime with the date of the original, but time set to midnight.no setter -
daysInMonth
→ List<
DateTime> -
Available on DateTime, provided by the DateExtension extension
The list of days in a given monthno setter - endOfDay → DateTime
-
Available on DateTime, provided by the DateExtension extension
Returns the end of Current dateno setter - endOfMonth → DateTime
-
Available on DateTime, provided by the DateExtension extension
Returns the end of the current month.no setter - endOfYear → DateTime
-
Available on DateTime, provided by the DateExtension extension
Returns the end of the current year.no setter - firstDayOfMonth → DateTime
-
Available on DateTime, provided by the DateExtension extension
Returns the first day of a given monthno setter - firstDayOfWeek → DateTime
-
Available on DateTime, provided by the DateExtension extension
Returns the first day of weekno setter - firstDayOfYear → DateTime
-
Available on DateTime, provided by the DateExtension extension
Returns the first day of the current year.no setter - formatted → String
-
Available on DateTime, provided by the DateExtension extension
Return date formatted stringno setter - isFirstDayOfMonth → bool
-
Available on DateTime, provided by the DateExtension extension
Check if the first day of a monthno setter - isLastDayOfMonth → bool
-
Available on DateTime, provided by the DateExtension extension
Check if the last day of a monthno setter - isToday → bool
-
Available on DateTime, provided by the DateExtension extension
Check if the date is todayno setter - isTomorrow → bool
-
Available on DateTime, provided by the DateExtension extension
Check if the date is tomorrowno setter - isWeekday → bool
-
Available on DateTime, provided by the DateExtension extension
Returns true when this date is Monday through Friday.no setter - isWeekend → bool
-
Available on DateTime, provided by the DateExtension extension
Returns true when this date is Saturday or Sunday.no setter - isYesterday → bool
-
Available on DateTime, provided by the DateExtension extension
Check if the date is yesterday, consider gap of year, month, dayno setter - lastDayOfMonth → DateTime
-
Available on DateTime, provided by the DateExtension extension
The last day of a given monthno setter - lastDayOfWeek → DateTime
-
Available on DateTime, provided by the DateExtension extension
Returns the last day of weekno setter - lastDayOfYear → DateTime
-
Available on DateTime, provided by the DateExtension extension
Returns the last day of the current year.no setter - nextDay → DateTime
-
Available on DateTime, provided by the DateExtension extension
The day after this DateTimeno setter - nextMonth → DateTime
-
Available on DateTime, provided by the DateExtension extension
Returns the next monthno setter - nextWeek → DateTime
-
Available on DateTime, provided by the DateExtension extension
Returns the next weekno setter - previousDay → DateTime
-
Available on DateTime, provided by the DateExtension extension
The day previous this DateTimeno setter - previousMonth → DateTime
-
Available on DateTime, provided by the DateExtension extension
Returns the previous monthno setter - previousWeek → DateTime
-
Available on DateTime, provided by the DateExtension extension
Returns the last weekno setter - startOfDay → DateTime
-
Available on DateTime, provided by the DateExtension extension
Returns the start of Current dateno setter - startOfMonth → DateTime
-
Available on DateTime, provided by the DateExtension extension
Returns the start of the current month.no setter - startOfYear → DateTime
-
Available on DateTime, provided by the DateExtension extension
Returns the start of the current year.no setter - timeOnly → Time
-
Available on DateTime, provided by the DateExtension extension
Returns only the time.no setter
Methods
-
addDays(
int amount) → DateTime -
Available on DateTime, provided by the DateExtension extension
Add a certain amount of days to this date -
addHours(
int amount) → DateTime -
Available on DateTime, provided by the DateExtension extension
Add a certain amount of hours to this date -
addMinutes(
int amount) → DateTime -
Available on DateTime, provided by the DateExtension extension
Add a certain amount of minutes to this date -
addMonths(
int amount) → DateTime -
Available on DateTime, provided by the DateExtension extension
Add a certain amount of months to this date and clamp overflow days. -
addSeconds(
int amount) → DateTime -
Available on DateTime, provided by the DateExtension extension
Add a certain amount of seconds to this date -
addYears(
int amount) → DateTime -
Available on DateTime, provided by the DateExtension extension
Add a certain amount of years to this date and clamp overflow days. -
daysUntil(
DateTime other) → int -
Available on DateTime, provided by the DateExtension extension
Returns the whole day difference from this date toother. -
format(
[String? format]) → String -
Available on DateTime, provided by the DateExtension extension
Returns date formatted string with support for custom format -
isBetween(
DateTime start, DateTime end, {bool includeStart = true, bool includeEnd = true}) → bool -
Available on DateTime, provided by the DateExtension extension
Returns true if this date is betweenstartandend. -
isSameDay(
DateTime b) → bool -
Available on DateTime, provided by the DateExtension extension
Whether or not two times are on the same day. -
isSameMonth(
DateTime b) → bool -
Available on DateTime, provided by the DateExtension extension
Whether or not two dates are in the same month. -
isSameWeek(
DateTime b) → bool -
Available on DateTime, provided by the DateExtension extension
Check if the date is on the same week for a given date -
isSameYear(
DateTime b) → bool -
Available on DateTime, provided by the DateExtension extension
Whether or not two dates are in the same year.