defmodule LSGWeb.Component do use Phoenix.Component @date_time_default_format "%F %H:%M" @date_time_formats %{"time-24-with-seconds" => "%H:%M:%S"} def naive_date_time_utc(assigns = %{format: format}) do assigns = assign(assigns, :format, Map.get(@date_time_formats, format, format)) ~H""" """ end def naive_date_time_utc(assigns) do naive_date_time_utc(assign(assigns, :format, "%F %H:%M")) end def get_luxon_format("%H:%M:%S"), do: "TIME_24_WITH_SECONDS" def nick(assigns = %{self: false}) do ~H""" <%= @nick %> """ end def nick(assigns = %{self: true}) do ~H""" You """ end end