Returns the first date in the list of dates.
DateTime? getFirstDate(Iterable<DateTime>? dates) => dates?.tryReduce((a, b) => a.isBefore(b) ? a : b);