Skip to content

Commit

Permalink
Fix order of training sessions on training page
Browse files Browse the repository at this point in the history
  • Loading branch information
treiher committed Nov 30, 2024
1 parent 6260db4 commit 8e84a49
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
3 changes: 2 additions & 1 deletion frontend/src/ui/page/training.rs
Original file line number Diff line number Diff line change
Expand Up @@ -252,11 +252,12 @@ pub fn view(model: &Model, data_model: &data::Model) -> Node<Msg> {
})
.copied()
.collect::<Vec<_>>();
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::<Vec<_>>();
training_sessions.sort_by_key(|t| t.date);
let training_sessions_interval: common::Interval =
data_model.training_sessions_date_range().into();
div![
Expand Down

0 comments on commit 8e84a49

Please sign in to comment.