Skip to content

Commit

Permalink
fix: respect session duration in include-past filter
Browse files Browse the repository at this point in the history
  • Loading branch information
JohnnyJayJay committed Sep 19, 2024
1 parent 1ebc448 commit e7bfb81
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/co/gaiwan/compass/model/session.clj
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
(:require
[co.gaiwan.compass.model.assets :as assets]
[clojure.string :as str]
[java-time.api :as time]))
[java-time.api :as time]
[co.gaiwan.compass.db :as db]))

(defn participating?
"If user participates this session"
Expand Down Expand Up @@ -96,7 +97,11 @@
(if v
sessions
(remove
#(time/before? (:session/time %) now)
#(time/before?
(time/+
(:session/time %)
(time/duration (:session/duration %)))
now)
sessions))))

(defmethod apply-filter :spots-available [sessions user k v]
Expand Down

0 comments on commit e7bfb81

Please sign in to comment.