philomena/lib/philomena_web/views/ban_view.ex

8 lines
178 B
Elixir
Raw Permalink Normal View History

2019-12-08 21:32:54 +01:00
defmodule PhilomenaWeb.BanView do
use PhilomenaWeb, :view
def active?(ban) do
2019-12-30 13:30:39 +01:00
ban.enabled and NaiveDateTime.diff(ban.valid_until, NaiveDateTime.utc_now()) > 0
2019-12-08 21:32:54 +01:00
end
end