Returns true if the date is in the same year as other, false otherwise.
true
other
false
bool isSameYear(DateTime other) => year == other.year;