format24 method
If the date did not exceed 24 hours will format jms else will format yMMMEd
Implementation
String format24(BuildContext context) {
var now = DateTime.now();
if (isAfter(now)) {
return _format(context, (locale) => DateFormat.yMMMEd(locale));
} else if (now.difference(this).inHours <= 24) {
return _format(context, (locale) => DateFormat.jms(locale));
} else {
return _format(context, (locale) => DateFormat.yMMMEd(locale));
}
}