diff --git a/lib/cannery_web/live/live_helpers.ex b/lib/cannery_web/live/live_helpers.ex index 293caf9..3510da5 100644 --- a/lib/cannery_web/live/live_helpers.ex +++ b/lib/cannery_web/live/live_helpers.ex @@ -56,10 +56,10 @@ defmodule CanneryWeb.LiveHelpers do phx-key="escape" > <%= live_patch to: @return_to, - id: "close", - class: - "absolute top-8 right-10 text-gray-500 hover:text-gray-800 transition-all duration-500 ease-in-out", - phx_click: hide_modal() do %> + id: "close", + class: + "absolute top-8 right-10 text-gray-500 hover:text-gray-800 transition-all duration-500 ease-in-out", + phx_click: hide_modal() do %> <% end %> diff --git a/lib/cannery_web/views/view_helpers.ex b/lib/cannery_web/views/view_helpers.ex index 3f68539..f1a7505 100644 --- a/lib/cannery_web/views/view_helpers.ex +++ b/lib/cannery_web/views/view_helpers.ex @@ -19,15 +19,37 @@ defmodule CanneryWeb.ViewHelpers do ~H""" + """ + end + + @doc """ + Returns a element that renders the Date in the user's local + timezone with Alpine.js + """ + @spec display_date(Date.t()) :: Phoenix.LiveView.Rendered.t() + def display_date(date) do + assigns = %{date: date |> Date.to_iso8601(:extended)} + + ~H""" + """ end