Skip to content

Commit

Permalink
FIx for only from timestamp
Browse files Browse the repository at this point in the history
  • Loading branch information
davidvanleeuwen committed Mar 13, 2024
1 parent d5e3fa6 commit ad96535
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion server/lib/mave_metrics/api.ex
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,9 @@ defmodule MaveMetrics.API do
end

defp apply_timeframe(query, timeframe, date_field) when is_number(timeframe) do
from = DateTime.from_unix!(timeframe) |> Timex.to_date()
from =
DateTime.from_unix!(from_timestamp, :second)
|> DateTime.truncate(:microsecond)

query
|> where([d], field(d, ^date_field) >= ^from)
Expand Down

0 comments on commit ad96535

Please sign in to comment.