DateTimeComparisonExtensions extension
Extensions on DateTime for comparison, range, and equality checks.
- on
Methods
-
isAfterNow(
[DateTime? now]) → bool -
Available on DateTime, provided by the DateTimeComparisonExtensions extension
Checks if the date is in the future compared to the current date and time. -
isAfterNullable(
DateTime? other) → bool -
Available on DateTime, provided by the DateTimeComparisonExtensions extension
Returnsfalseifotherisnull, otherwise returns the result of comparing this DateTime withotherusing theisAftermethod. -
isAnnualDateInRange(
DateTimeRange< DateTime> ? range, {bool isInclusive = true}) → bool -
Available on DateTime, provided by the DateTimeComparisonExtensions extension
Returnstrueif this DateTime is within the specifiedrange. -
isBeforeNow(
[DateTime? now]) → bool -
Available on DateTime, provided by the DateTimeComparisonExtensions extension
Checks if the date is in the past compared to the current date and time. -
isBeforeNullable(
DateTime? other) → bool -
Available on DateTime, provided by the DateTimeComparisonExtensions extension
Returnsfalseifotherisnull, otherwise returns the result of comparing this DateTime withotherusing theisBeforemethod. -
isBetween(
DateTime start, DateTime end, {bool isInclusive = true}) → bool -
Available on DateTime, provided by the DateTimeComparisonExtensions extension
Returnstrueif this DateTime is betweenstartandend. -
isBetweenRange(
DateTimeRange< DateTime> ? range, {bool isInclusive = true}) → bool -
Available on DateTime, provided by the DateTimeComparisonExtensions extension
Returnstrueif this DateTime is within the specifiedrange,falseifrangeisnull. -
isDateAfterToday(
{DateTime? now}) → bool -
Available on DateTime, provided by the DateTimeComparisonExtensions extension
Returns true if this date is strictly after today (i.e., tomorrow or later). -
isSameDateOnly(
DateTime other) → bool -
Available on DateTime, provided by the DateTimeComparisonExtensions extension
Checks if the current DateTime has the same date (year, month, day) as another DateTime. -
isSameDateOrAfter(
DateTime other) → bool -
Available on DateTime, provided by the DateTimeComparisonExtensions extension
Returns true if this date (date-only) is the same as or afterother. -
isSameDateOrBefore(
DateTime other) → bool -
Available on DateTime, provided by the DateTimeComparisonExtensions extension
Returns true if this date (date-only) is the same as or beforeother. -
isSameDayMonth(
DateTime other) → bool -
Available on DateTime, provided by the DateTimeComparisonExtensions extension
Checks if the current DateTime has the same day and month as another DateTime. -
isSameMonth(
DateTime other) → bool -
Available on DateTime, provided by the DateTimeComparisonExtensions extension
Checks if the current DateTime has the same month as another DateTime. -
isToday(
{DateTime? now, bool ignoreYear = false}) → bool -
Available on DateTime, provided by the DateTimeComparisonExtensions extension
Returnstrueif this DateTime matches the current date (today). -
isYearCurrent(
{DateTime? now}) → bool -
Available on DateTime, provided by the DateTimeComparisonExtensions extension
Checks if the date is in the current calendar year. -
toDateOnly(
) → DateTime -
Available on DateTime, provided by the DateTimeComparisonExtensions extension
Removes the time component from the DateTime object, returning only the date part (year, month, and day).