With Ecto-Date fields I can do query comparisons like this:
from(e in query, where: fragment("? > NOW() - interval '24 hours'", e.some_date))
However that does not work.
operator does not exist: datetimetz > timestamp with time zone
I tried using Timex to generate the value to compare, but that did not work either:
from(e in query, where: e.some_date > ^one_day_ago())
defp one_day_ago do
Timex.now()
|> Timex.shift(hours: -24)
end