formatThird function
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;
}
}