isSameDay method

bool isSameDay(
  1. DateTime other
)

Returns true if the date is on the same day as other.

Example:

DateTime(2024, 1, 15, 10).isSameDay(DateTime(2024, 1, 15, 20)); // true

Implementation

bool isSameDay(DateTime other) {
  return year == other.year && month == other.month && day == other.day;
}