forked from firka/student-legacy
today, yesterday fix
This commit is contained in:
parent
3cf57ac6d4
commit
c3b79fcb3f
@ -37,11 +37,11 @@ extension DateFormatUtils on DateTime {
|
||||
if (timeOnly) return DateFormat("HH:mm").format(this);
|
||||
|
||||
DateTime now = DateTime.now();
|
||||
if (this.difference(now).inDays == 0) {
|
||||
if (now.year == this.year && now.month == this.month && now.day == this.day) {
|
||||
if (this.hour == 0 && this.minute == 0 && this.second == 0) return "Today".i18n;
|
||||
return DateFormat("HH:mm").format(this);
|
||||
}
|
||||
if (this.difference(now).inDays == 1) return "Yesterday".i18n;
|
||||
if (now.year == this.year && now.month == this.month && now.subtract(Duration(days: 1)).day == this.day) return "Yesterday".i18n;
|
||||
|
||||
String formatString;
|
||||
if (this.year == now.year)
|
||||
|
Loading…
x
Reference in New Issue
Block a user