fix(message-date-label): take absolute value to prevent -x days ago

This commit is contained in:
Kiril Tijsma 2025-03-10 08:40:59 +01:00 committed by FlutterJoey
parent b8e22425a1
commit 3cec2ee1c6

View file

@ -168,7 +168,7 @@ class ChatTranslations {
-1 => "Yesterday", -1 => "Yesterday",
1 => "Tomorrow", 1 => "Tomorrow",
int value when value < 5 && value > 1 => "In $value days", int value when value < 5 && value > 1 => "In $value days",
int value when value < -1 && value > -5 => "$value days ago", int value when value < -1 && value > -5 => "${value.abs()} days ago",
_ => DateFormat("dd-MM-YYYY").format(time), _ => DateFormat("dd-MM-YYYY").format(time),
}; };