Browse Source

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

master
Astro 6 months ago
parent
commit
53a11663ee
1 changed files with 2 additions and 1 deletions
  1. 2
    1
      ticker-serve/src/index.rs

+ 2
- 1
ticker-serve/src/index.rs View File

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

Loading…
Cancel
Save