sortDates function

List<DateTime> sortDates(
  1. List<DateTime> dates
)

Checks if two dates are on the same year.

Implementation

List<DateTime> sortDates(List<DateTime> dates) {
  final copy = List<DateTime>.from(dates);
  return copy..sort((a, b) => a.compareTo(b));
}