mirror of
https://github.com/wger-project/flutter.git
synced 2026-02-18 00:17:48 +01:00
Correctly order workout logs by date
This commit is contained in:
@@ -60,7 +60,7 @@ class WorkoutPlan {
|
||||
/// Filters the workout logs by exercise and sorts them by date
|
||||
List<Log> filterLogsByExercise(Exercise exercise) {
|
||||
var out = logs.where((element) => element.exerciseId == exercise.id).toList();
|
||||
out.sort((a, b) => a.date.compareTo(b.date));
|
||||
out.sort((a, b) => b.date.compareTo(a.date));
|
||||
return out;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user