DateComparisons class

Date comparison utilities

Constructors

DateComparisons()

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited

Static Methods

isAfternoon(DateTime date) bool
Check if a time is in the afternoon (12:00 PM - 5:59 PM)
isBetween(DateTime date, DateTime start, DateTime end, {bool inclusive = true}) bool
Check if a date is between two other dates (inclusive)
isEvening(DateTime date) bool
Check if a time is in the evening (6:00 PM - 9:59 PM)
isFirstHalfOfMonth(DateTime date) bool
Check if a date is in the first half of the month (1-15)
isFirstQuarter(DateTime date) bool
Check if a date is in the first quarter of the year
isFourthQuarter(DateTime date) bool
Check if a date is in the fourth quarter of the year
isFriday(DateTime date) bool
Check if a date is on Friday
isFuture(DateTime date) bool
Check if a date is in the future
isLastMonth(DateTime date) bool
Check if a date is last month
isLastWeek(DateTime date) bool
Check if a date is last week
isLastYear(DateTime date) bool
Check if a date is last year
isLeapYear(int year) bool
Check if a year is a leap year
isLeapYearDate(DateTime date) bool
Check if a date falls on a leap year
isMonday(DateTime date) bool
Check if a date is on Monday
isMorning(DateTime date) bool
Check if a time is in the morning (6:00 AM - 11:59 AM)
isNextMonth(DateTime date) bool
Check if a date is next month
isNextWeek(DateTime date) bool
Check if a date is next week
isNextYear(DateTime date) bool
Check if a date is next year
isNight(DateTime date) bool
Check if a time is at night (10:00 PM - 5:59 AM)
isPast(DateTime date) bool
Check if a date is in the past
isSameDay(DateTime date1, DateTime date2) bool
Check if two dates are on the same day
isSameHour(DateTime date1, DateTime date2) bool
Check if two dates are on the same hour
isSameMinute(DateTime date1, DateTime date2) bool
Check if two dates are on the same minute
isSameMonth(DateTime date1, DateTime date2) bool
Check if two dates are in the same month
isSameWeek(DateTime date1, DateTime date2) bool
Check if two dates are in the same week
isSameYear(DateTime date1, DateTime date2) bool
Check if two dates are in the same year
isSaturday(DateTime date) bool
Check if a date is on Saturday
isSecondHalfOfMonth(DateTime date) bool
Check if a date is in the second half of the month (16-31)
isSecondQuarter(DateTime date) bool
Check if a date is in the second quarter of the year
isSunday(DateTime date) bool
Check if a date is on Sunday
isThirdQuarter(DateTime date) bool
Check if a date is in the third quarter of the year
isThisMonth(DateTime date) bool
Check if a date is in the current month
isThisWeek(DateTime date) bool
Check if a date is in the current week
isThisYear(DateTime date) bool
Check if a date is in the current year
isThursday(DateTime date) bool
Check if a date is on Thursday
isToday(DateTime date) bool
Check if a date is today
isTomorrow(DateTime date) bool
Check if a date is tomorrow
isTuesday(DateTime date) bool
Check if a date is on Tuesday
isWednesday(DateTime date) bool
Check if a date is on Wednesday
isWeekday(DateTime date) bool
Check if a date is a weekday (Monday to Friday)
isWeekend(DateTime date) bool
Check if a date is a weekend (Saturday or Sunday)
isWithinDays(DateTime date, int days) bool
Check if a date is within N days from now
isWithinMonths(DateTime date, int months) bool
Check if a date is within N months from now
isWithinWeeks(DateTime date, int weeks) bool
Check if a date is within N weeks from now
isWithinYears(DateTime date, int years) bool
Check if a date is within N years from now
isYesterday(DateTime date) bool
Check if a date is yesterday