diff --git a/src/repo/postgres.rs b/src/repo/postgres.rs index 8fc46eb..cc899e8 100644 --- a/src/repo/postgres.rs +++ b/src/repo/postgres.rs @@ -904,7 +904,7 @@ fn query_from_filter(f: &ReqFilter) -> Option> { } push_and = true; query - .push("e.created_at > ") + .push("e.created_at >= ") .push_bind(Utc.timestamp_opt(f.since.unwrap() as i64, 0).unwrap()); } @@ -915,7 +915,7 @@ fn query_from_filter(f: &ReqFilter) -> Option> { } push_and = true; query - .push("e.created_at < ") + .push("e.created_at <= ") .push_bind(Utc.timestamp_opt(f.until.unwrap() as i64, 0).unwrap()); } diff --git a/src/repo/sqlite.rs b/src/repo/sqlite.rs index 87d8556..8f5b798 100644 --- a/src/repo/sqlite.rs +++ b/src/repo/sqlite.rs @@ -1083,13 +1083,13 @@ fn query_from_filter(f: &ReqFilter) -> (String, Vec>, Option {}", f.since.unwrap()); + since_clause = format!("AND created_at >= {}", f.since.unwrap()); } else { since_clause = String::new(); }; // Query for timestamp if f.until.is_some() { - until_clause = format!("AND created_at < {}", f.until.unwrap()); + until_clause = format!("AND created_at <= {}", f.until.unwrap()); } else { until_clause = String::new(); }; @@ -1107,12 +1107,12 @@ fn query_from_filter(f: &ReqFilter) -> (String, Vec>, Option {}", f.since.unwrap()); + let created_clause = format!("created_at >= {}", f.since.unwrap()); filter_components.push(created_clause); } // Query for timestamp if f.until.is_some() { - let until_clause = format!("created_at < {}", f.until.unwrap()); + let until_clause = format!("created_at <= {}", f.until.unwrap()); filter_components.push(until_clause); } // never display hidden events