Browse Source

serve: filter by dtend not dtstart

master
Astro 12 months ago
parent
commit
3732a038ed
  1. 4
      ticker-serve/src/index.rs

4
ticker-serve/src/index.rs

@ -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)

Loading…
Cancel
Save