From c9a217f0eae1abfe5e73d0a889bf0b93ed8e8d96 Mon Sep 17 00:00:00 2001 From: Joakim Hulthe Date: Thu, 6 May 2021 20:10:50 +0200 Subject: [PATCH] Tweak calendar borders --- server/src/routes/pages/stats.rs | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/server/src/routes/pages/stats.rs b/server/src/routes/pages/stats.rs index 61b069e..98f9852 100644 --- a/server/src/routes/pages/stats.rs +++ b/server/src/routes/pages/stats.rs @@ -352,14 +352,9 @@ where let month = day.month(); - let month_border = |other_day| match days.get(&other_day) { - Some(_) => other_day.month() != month, - None => true, - }; - - let month_or_week_border = |other_day| match days.get(&other_day) { - Some(_) => other_day.iso_week() != week || month_border(other_day), - None => true, + let month_border = |other_day: Date<_>| other_day.month() != month; + let month_or_week_border = |other_day: Date<_>| { + other_day.iso_week() != week || month_border(other_day) }; const MIN_WEIGHT: f32 = 0.5; @@ -378,7 +373,6 @@ where duration, }; - //(day.weekday(), Some(ctx)) Some(ctx) }) .collect()