isSameYear method

bool isSameYear(
  1. DateTime date
)

Checks whether the date is in the same year as the given date

Implementation

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