From 681009679512345bab11fff69bae475ab2d242f8 Mon Sep 17 00:00:00 2001 From: Robert Malikowski Date: Fri, 26 Jun 2026 10:37:08 +0200 Subject: [PATCH] fix today threshold --- lib/view_model/dashboard/formatted_item_list.dart | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/view_model/dashboard/formatted_item_list.dart b/lib/view_model/dashboard/formatted_item_list.dart index 2348222c5..45dfb663d 100644 --- a/lib/view_model/dashboard/formatted_item_list.dart +++ b/lib/view_model/dashboard/formatted_item_list.dart @@ -9,7 +9,7 @@ List formattedItemsList(List items) { items.sort((a, b) => b.date.compareTo(a.date)); final now = DateTime.now(); - final last24hThreshold = now.subtract(const Duration(hours: 24)); + final todayTreshold = DateTime(now.year, now.month, now.day); final last7daysThreshold = now.subtract(const Duration(days: 7)); final last30daysThreshold = now.subtract(const Duration(days: 30)); @@ -19,7 +19,7 @@ List formattedItemsList(List items) { for (final transaction in items) { final date = transaction.date; - final bucket = date.isAfter(last24hThreshold) + final bucket = date.isAfter(todayTreshold) ? _DateBucket.recent : date.isAfter(last7daysThreshold) ? _DateBucket.last7Days @@ -33,7 +33,7 @@ List formattedItemsList(List items) { formattedList.add( TodayTransactionItem( date, - key: const ValueKey("last_7_days_section_item_key"), + key: const ValueKey("today_section_item_key"), ), ); }