fix: correctly sort

This commit is contained in:
Matyáš Caras 2024-01-08 21:15:24 +01:00
parent 2873848e74
commit b621133c24
Signed by untrusted user who does not match committer: hernik
GPG key ID: 2A3175F98820C5C6
2 changed files with 3 additions and 2 deletions

View file

@ -5,6 +5,7 @@
- Categories now have changeable colors assigned to them - Categories now have changeable colors assigned to them
- Added pie chart for expense/income data per category - Added pie chart for expense/income data per category
- Added recurring entries - Added recurring entries
- Fixed wrong default sorting
# 1.0.0-alpha+2 # 1.0.0-alpha+2
- Fixed localization issues - Fixed localization issues
- Added graphs for expenses and income per month/year - Added graphs for expenses and income per month/year

View file

@ -302,8 +302,8 @@ class _HomeViewState extends State<HomeView> {
if (yearA == null) return 0; if (yearA == null) return 0;
final yearB = RegExp(r'\d+').firstMatch(b); final yearB = RegExp(r'\d+').firstMatch(b);
if (yearB == null) return 0; if (yearB == null) return 0;
final compareYears = int.parse(yearA.group(0)!) final compareYears = int.parse(yearB.group(0)!)
.compareTo(int.parse(yearB.group(0)!)); .compareTo(int.parse(yearA.group(0)!));
if (compareYears != 0) return compareYears; if (compareYears != 0) return compareYears;
final months = List<String>.generate( final months = List<String>.generate(
12, 12,