serve/index: filter by dtstart>=today for dtend=null

This commit is contained in:
Astro 2021-03-08 23:01:00 +01:00
parent 247b2c28e9
commit 53a11663ee
1 changed files with 2 additions and 1 deletions

View File

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