Check if two dates are in the same year
static bool isSameYear(DateTime date1, DateTime date2) { return date1.year == date2.year; }