<%= if @query.period == "month" do %>
<%= link(to: "/#{@site.domain}?period=month&date=#{@query.date_range.first |> Timex.shift(months: -1) |> Timex.format!("{ISOdate}")}", class: "flex items-center px-2 border-r border-grey-light") do %>
<% end %>
<%= link(to: "/#{@site.domain}?period=month&date=#{@query.date_range.first |> Timex.shift(months: 1) |> Timex.format!("{ISOdate}")}", class: "flex items-center px-2") do %>
<% end %>
<% end %>
<%= if @query.period == "day" do %>
<%= link(to: "/#{@site.domain}?period=day&date=#{@query.date_range.first |> Timex.shift(days: -1) |> Timex.format!("{ISOdate}")}", class: "flex items-center px-2 border-r border-grey-light") do %>
<% end %>
<%= link(to: "/#{@site.domain}?period=day&date=#{@query.date_range.first |> Timex.shift(days: 1) |> Timex.format!("{ISOdate}")}", class: "flex items-center px-2") do %>
<% end %>
<% end %>
<%= timeframe_text(@site, @query) %>
<%= link("Today", to: "/#{@site.domain}?period=day", class: "block p-2 hover:bg-grey-lighter") %>
<%= link("Last 7 days", to: "/#{@site.domain}?period=7d", class: "block px-2 py-3 hover:bg-grey-lighter") %>
<%= link("This month", to: "/#{@site.domain}?period=month", class: "block p-2 hover:bg-grey-lighter") %>
<%= link("Last month", to: "/#{@site.domain}?period=month&date=#{last_month(@site) |> Timex.format!("{ISOdate}")}", class: "block p-2 hover:bg-grey-lighter") %>
<%= link("Last 3 months", to: "/#{@site.domain}?period=3mo", class: "block p-2 hover:bg-grey-lighter") %>
<%= link("Last 6 months", to: "/#{@site.domain}?period=6mo", class: "block p-2 hover:bg-grey-lighter") %>