earlierOf function

Date? earlierOf(
  1. Date a,
  2. Date? b
)

Gets the earlier of the two given dates.

Requires both dates to be non-null.

Implementation

Date? earlierOf(Date a, Date? b) => a.isAfter(b) ? b : a;