From 80e93fa4761fd3f08a96aaf475309b3bd10af1a2 Mon Sep 17 00:00:00 2001 From: Jeremy Wall Date: Wed, 18 Jan 2023 21:09:28 -0500 Subject: [PATCH] sort the plan dates in descending order in the ui --- web/src/pages/planning/select.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/web/src/pages/planning/select.rs b/web/src/pages/planning/select.rs index 78894e1..b361879 100644 --- a/web/src/pages/planning/select.rs +++ b/web/src/pages/planning/select.rs @@ -23,12 +23,14 @@ use sycamore::prelude::*; #[component] pub fn SelectPage<'ctx, G: Html>(cx: Scope<'ctx>, sh: StateHandler<'ctx>) -> View { let plan_dates = sh.get_selector(cx, |state| { - state + let mut plans = state .get() .plan_dates .iter() .cloned() - .collect::>() + .collect::>(); + plans.sort_unstable_by(|d1, d2| d2.cmp(d1)); + plans }); view! {cx, PlanningPage(