fix today threshold
Robert Malikowski committed
Jun 26, 2026 at 10:37 UTC
681009679512345bab11fff69bae475ab2d242f8
1 file changed
+3
-3
lib/view_model/dashboard/formatted_item_list.dart
+3
-3
@@ -9,7 +9,7 @@ List<ActionListItem> formattedItemsList(List<ActionListItem> items) {
9
items.sort((a, b) => b.date.compareTo(a.date));
10
11
final now = DateTime.now();
12
- final last24hThreshold = now.subtract(const Duration(hours: 24));
12
+ final todayTreshold = DateTime(now.year, now.month, now.day);
13
final last7daysThreshold = now.subtract(const Duration(days: 7));
14
final last30daysThreshold = now.subtract(const Duration(days: 30));
15
@@ -19,7 +19,7 @@ List<ActionListItem> formattedItemsList(List<ActionListItem> items) {
19
for (final transaction in items) {
20
final date = transaction.date;
21
22
- final bucket = date.isAfter(last24hThreshold)
22
+ final bucket = date.isAfter(todayTreshold)
23
? _DateBucket.recent
24
: date.isAfter(last7daysThreshold)
25
? _DateBucket.last7Days
@@ -33,7 +33,7 @@ List<ActionListItem> formattedItemsList(List<ActionListItem> items) {
33
formattedList.add(
34
TodayTransactionItem(
35
date,
36
- key: const ValueKey("last_7_days_section_item_key"),
36
+ key: const ValueKey("today_section_item_key"),
37
),
38
);
39
}