Returns 'AM' or 'PM' based on the period of the given TimeOfDay.
static String getAmPm(TimeOfDay time) { return time.period == DayPeriod.am ? 'AM' : 'PM'; }