isSameYear method

bool isSameYear(
  1. DateTime date
)

Indicates whether two DateTime objects are in the same year.

Implementation

bool isSameYear(DateTime date) {
  return year == date.year;
}