Gets the earlier of the two given dates.
Requires both dates to be non-null.
Date earlierOf(Date a, Date b) => a.isAfter(b) ? b : a;