dateTimeFormat function
Implementation
String dateTimeFormat(String format, DateTime? dateTime) {
if (dateTime == null) {
return '';
}
if (format == 'relative') {
return timeago.format(dateTime);
}
return DateFormat(format).format(dateTime);
}