getWhen static method
Implementation
static getWhen(DateTime date) {
DateTime now = DateTime.now();
String when;
if (date.isToday()) {
when = appTranslateText('today');
} else if (date.day == now.subtract(const Duration(days: 1)).day) {
when = appTranslateText('yesterday');
} else {
when = DateFormat.MMMd().format(date);
}
return when;
}