DateChecks extension

on

Properties

isToday bool
Returns true if the date is today
no setter
isTomorrow bool
Returns true if the date is tomorrow
no setter
isYesterday bool
Returns true if the date is yesterday
no setter

Methods

isAtSameDayAs(DateTime other) bool
Returns true if other is on the same day as this. This means the exact day, including year and month. Does not account for timezones
isAtSameHourAs(DateTime other) bool
Returns true if other is at the same hour as this. This means the exact hour, including year, month and day. Does not account for timezones
isAtSameMinuteAs(DateTime other) bool
Returns true if other is at the same minute as this. This means the exact minute, including year, month, day and hour. Does not account for timezones
isAtSameMonthAs(DateTime other) bool
Returns true if other is in the same month as this. This means the exact month, including year. Does not account for timezones
isAtSameSecondAs(DateTime other) bool
Returns true if other is at the same second as this. This means the exact second, including year, month, day, hour and minute. Does not account for timezones.
isAtSameYearAs(DateTime other) bool
Returns true if other is in the same year as this. Does not account for timezones
isSameDay(DateTime other) bool
Returns true if two dates are equal by year, month and day