formatTwo function

DateTime? formatTwo(
  1. String date
)

Implementation

DateTime? formatTwo(String date) {
  DateTime? maybeTime;
  try {
    List<String> times = date.split(" ");
    maybeTime = format2.parse(times[1]);
    maybeTime = maybeTime.copyWith(year: DateTime.now().year);
    return maybeTime;
  } catch (_) {
    return maybeTime;
  }
}