chore: Change same enivornment to one hour

pull/1421/head
Krille 4 months ago
parent c76a5fd030
commit d088a7c154
No known key found for this signature in database
GPG Key ID: E067ECD60F1A0652

@ -21,17 +21,10 @@ extension DateTimeExtension on DateTime {
return millisecondsSinceEpoch <= other.millisecondsSinceEpoch;
}
/// Two message events can belong to the same environment. That means that they
/// don't need to display the time they were sent because they are close
/// enaugh.
static const minutesBetweenEnvironments = 10;
/// Checks if two DateTimes are close enough to belong to the same
/// environment.
bool sameEnvironment(DateTime prevTime) {
return millisecondsSinceEpoch - prevTime.millisecondsSinceEpoch <
1000 * 60 * minutesBetweenEnvironments;
}
bool sameEnvironment(DateTime prevTime) =>
prevTime.difference(this) < const Duration(hours: 1);
/// Returns a simple time String.
String localizedTimeOfDay(BuildContext context) =>

Loading…
Cancel
Save