From b621133c2405c753ec993a1a5b42fa37a755ca0b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maty=C3=A1=C5=A1=20Caras?= Date: Mon, 8 Jan 2024 21:15:24 +0100 Subject: [PATCH] fix: correctly sort --- CHANGELOG.md | 1 + lib/views/home.dart | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d6c7440..5d8977c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,7 @@ - Categories now have changeable colors assigned to them - Added pie chart for expense/income data per category - Added recurring entries +- Fixed wrong default sorting # 1.0.0-alpha+2 - Fixed localization issues - Added graphs for expenses and income per month/year diff --git a/lib/views/home.dart b/lib/views/home.dart index 2ed0fac..950c459 100644 --- a/lib/views/home.dart +++ b/lib/views/home.dart @@ -302,8 +302,8 @@ class _HomeViewState extends State { if (yearA == null) return 0; final yearB = RegExp(r'\d+').firstMatch(b); if (yearB == null) return 0; - final compareYears = int.parse(yearA.group(0)!) - .compareTo(int.parse(yearB.group(0)!)); + final compareYears = int.parse(yearB.group(0)!) + .compareTo(int.parse(yearA.group(0)!)); if (compareYears != 0) return compareYears; final months = List.generate( 12,