date dividing bug fixed

This commit is contained in:
MhdZiadHirati 2023-10-26 08:50:30 +03:00
parent c0c31e16e4
commit 2133544b56

View File

@ -40,9 +40,12 @@ class Utils {
// }
static String formatDateDifference(DateTime date) {
final now = DateTime.now();
final now = DateTime.now().toLocal();
final difference = now.difference(date).inDays;
if (difference == 0 && now.day != date.day) {
return 'yesterday'.tr;
}
if (difference == 0) {
return 'today'.tr;
} else if (difference == 1) {