From 7d55cdd2a25287d735a6ee5a5fd2d40e8e1b9f8f Mon Sep 17 00:00:00 2001 From: Uku Taht Date: Wed, 20 Nov 2019 16:32:00 +0800 Subject: [PATCH] Remove unused code in query --- lib/plausible/stats/query.ex | 18 ------------------ 1 file changed, 18 deletions(-) diff --git a/lib/plausible/stats/query.ex b/lib/plausible/stats/query.ex index 7ae9d28cb..aa84268b2 100644 --- a/lib/plausible/stats/query.ex +++ b/lib/plausible/stats/query.ex @@ -1,24 +1,6 @@ defmodule Plausible.Stats.Query do defstruct [date_range: nil, step_type: nil, period: nil, steps: nil, filters: %{}] - def new(attrs) do - attrs - |> Enum.into(%{}) - |> Map.put(:__struct__, __MODULE__) - end - - def month(date) do - %__MODULE__{ - date_range: Date.range(Timex.beginning_of_month(date), Timex.end_of_month(date)) - } - end - - def day(date) do - %__MODULE__{ - date_range: Date.range(date, date) - } - end - def shift_back(%__MODULE__{period: "day"} = query) do new_date = query.date_range.first |> Timex.shift(days: -1) Map.put(query, :date_range, Date.range(new_date, new_date))