time_parts library

Functions

clockHour(int hour24) → int
Clock helpers for an hour and minute picker.
formatHhMm(TimeOfDay time, {bool use24Hour = true}) → String
14:30 in 24-hour mode, or 02:30 PM in 12-hour mode.
hour24FromClock(int clock, DayPeriod period) → int
Converts a 12-hour clock hour plus AM/PM into an hour from 0 to 23.
normalizeTime(TimeOfDay time, {int minuteInterval = 1}) → TimeOfDay
Snaps time to the nearest minuteInterval.
tryParseHhMm(String text) → TimeOfDay?
Parses HH:mm, or hh:mm AM / hh:mm PM. Returns null when it is not a real time.