diff --git a/CHANGELOG.md b/CHANGELOG.md index c0248fe..d7d3fb1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -32,6 +32,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Fixed - Reject trainings, body weight, body fat and period entries in the future +- Order of training sessions on training page ## [0.4.1] - 2024-05-20 diff --git a/frontend/src/ui/page/training.rs b/frontend/src/ui/page/training.rs index 43b0806..2f51fa8 100644 --- a/frontend/src/ui/page/training.rs +++ b/frontend/src/ui/page/training.rs @@ -252,11 +252,12 @@ pub fn view(model: &Model, data_model: &data::Model) -> Node { }) .copied() .collect::>(); - let training_sessions = data_model + let mut training_sessions = data_model .training_sessions .values() .filter(|t| t.date >= model.interval.first && t.date <= model.interval.last) .collect::>(); + training_sessions.sort_by_key(|t| t.date); let training_sessions_interval: common::Interval = data_model.training_sessions_date_range().into(); div![