Checks if two dates are on the same year.
List<DateTime> sortDates(List<DateTime> dates) { final copy = List<DateTime>.from(dates); return copy..sort((a, b) => a.compareTo(b)); }