formatThird function

DateTime? formatThird(
  1. String date
)

Implementation

DateTime? formatThird(String date) {
  DateTime? maybeTime;
  try {
    maybeTime = DateFormat("HH:mm").parse(date);
    var now = DateTime.now();
    maybeTime =
        maybeTime.copyWith(year: now.year, month: now.month, day: now.day);
    return maybeTime;
  } catch (_) {
    return maybeTime;
  }
}