serve: filter by dtend not dtstart

This commit is contained in:
Astro 2020-10-30 17:21:06 +01:00
parent 9e53e41f5f
commit 3732a038ed
1 changed files with 2 additions and 2 deletions

View File

@ -59,8 +59,8 @@ fn render_index(app_state: &AppState) -> String {
let limit = Local::today().naive_local().and_hms(0, 0, 0) +
Duration::weeks(2);
let es = events
.filter(schema::events::dtstart.ge(&today))
.filter(schema::events::dtstart.lt(&limit))
.filter(schema::events::dtend.ge(&today))
.filter(schema::events::dtend.lt(&limit))
.order_by(schema::events::dtstart.asc())
.then_order_by(schema::events::dtend.desc())
.load::<Event>(&*db)