diff --git a/lib/storage/storage.dart b/lib/storage/storage.dart index e5c989c..ac4598b 100644 --- a/lib/storage/storage.dart +++ b/lib/storage/storage.dart @@ -139,11 +139,11 @@ class FoodStorage { Future buildFoodLookupDatabase() async { // get a list of dates of the last 365 days var dates = List.generate(365, (idx) { - var pastDay = Duration(days: idx); - return DateTime.now().subtract(pastDay); + var durationToPast = Duration(days: idx); + return DateTime.now().subtract(durationToPast); }); - for (var date in dates) { + for (var date in dates.reversed) { addFoodEntryToLookupDatabaseFor(date); } }