forked from potsda.mn/mobilizon
show events until their end time, unless they have no end time
This commit is contained in:
parent
13306dc1bc
commit
aaee131f1d
|
@ -1663,7 +1663,7 @@ defmodule Mobilizon.Events do
|
||||||
@spec filter_future_events(Ecto.Queryable.t(), boolean) :: Ecto.Query.t()
|
@spec filter_future_events(Ecto.Queryable.t(), boolean) :: Ecto.Query.t()
|
||||||
defp filter_future_events(query, true) do
|
defp filter_future_events(query, true) do
|
||||||
from(q in query,
|
from(q in query,
|
||||||
where: q.begins_on > ^DateTime.utc_now()
|
where: coalesce(q.ends_on, q.begins_on) > ^DateTime.utc_now()
|
||||||
)
|
)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue