From 1581570d97bf1270f6c0edb312fc070be3e79d24 Mon Sep 17 00:00:00 2001 From: philipp Date: Mon, 9 Oct 2023 20:42:01 +0200 Subject: [PATCH] fix off-by-one error of not showing 'always show' trips 7 days before the event --- src/model/planned_event.rs | 2 +- src/model/user.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/model/planned_event.rs b/src/model/planned_event.rs index ae7dfa4..e29f36e 100644 --- a/src/model/planned_event.rs +++ b/src/model/planned_event.rs @@ -26,7 +26,7 @@ pub struct PlannedEvent { is_locked: bool, } -#[derive(Serialize)] +#[derive(Serialize, Debug)] pub struct PlannedEventWithUserAndTriptype { #[serde(flatten)] pub planned_event: PlannedEvent, diff --git a/src/model/user.rs b/src/model/user.rs index 068fc05..fe570f2 100644 --- a/src/model/user.rs +++ b/src/model/user.rs @@ -289,7 +289,7 @@ ORDER BY last_access DESC } } - for date in TripDetails::pinned_days(db, self.amount_days_to_show()).await { + for date in TripDetails::pinned_days(db, self.amount_days_to_show() - 1).await { if self.is_guest { let day = Day::new_guest(db, date, true).await; if !day.planned_events.is_empty() {