Revert "design: New date separators in timeline"
This reverts commit f15b81c5a6.
This commit is contained in:
parent
f15b81c5a6
commit
554f951a30
6 changed files with 79 additions and 134 deletions
|
|
@ -45,7 +45,7 @@ extension DateTimeExtension on DateTime {
|
|||
|
||||
/// Returns [localizedTimeOfDay()] if the ChatTime is today, the name of the week
|
||||
/// day if the ChatTime is this week and a date string else.
|
||||
String localizedTimeShort(BuildContext context, {bool dateOnly = false}) {
|
||||
String localizedTimeShort(BuildContext context) {
|
||||
final now = DateTime.now();
|
||||
|
||||
final sameYear = now.year == year;
|
||||
|
|
@ -58,7 +58,7 @@ extension DateTimeExtension on DateTime {
|
|||
1000 * 60 * 60 * 24 * 7;
|
||||
|
||||
if (sameDay) {
|
||||
return dateOnly ? L10n.of(context)!.today : localizedTimeOfDay(context);
|
||||
return localizedTimeOfDay(context);
|
||||
} else if (sameWeek) {
|
||||
return DateFormat.EEEE(Localizations.localeOf(context).languageCode)
|
||||
.format(this);
|
||||
|
|
@ -92,9 +92,5 @@ extension DateTimeExtension on DateTime {
|
|||
);
|
||||
}
|
||||
|
||||
bool isSameDate(DateTime other) {
|
||||
return year == other.year && month == other.month && day == other.day;
|
||||
}
|
||||
|
||||
static String _z(int i) => i < 10 ? '0${i.toString()}' : i.toString();
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue