forked from eatvio/eatvio_app
feat(chat): add chat images/files preview
This commit is contained in:
@@ -33,7 +33,7 @@ extension DateTimeExtension on DateTime {
|
||||
}
|
||||
}
|
||||
|
||||
String calculateDifference(DateTime dateTime) {
|
||||
String calculateDifference(DateTime dateTime, [String? format]) {
|
||||
final localDateTime = dateTime.isUtc ? dateTime.toLocal() : dateTime;
|
||||
|
||||
if (localDateTime.isToday()) {
|
||||
@@ -41,6 +41,6 @@ String calculateDifference(DateTime dateTime) {
|
||||
} else if (localDateTime.isYesterday()) {
|
||||
return 'Вчера';
|
||||
} else {
|
||||
return localDateTime.format('d MMMM', 'ru');
|
||||
return localDateTime.format(format ?? 'd MMMM', 'ru');
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user