From 98bb99881de8f4ebdfbf8dbb9b5ede6995d91746 Mon Sep 17 00:00:00 2001 From: shibao Date: Sat, 18 Mar 2023 00:45:16 -0400 Subject: [PATCH] add ids to dynamic date and datetime elements --- lib/memex_web/components/core_components.ex | 2 ++ lib/memex_web/components/core_components/date.html.heex | 2 +- lib/memex_web/components/core_components/datetime.html.heex | 2 +- lib/memex_web/components/core_components/user_card.html.heex | 4 ++-- 4 files changed, 6 insertions(+), 4 deletions(-) diff --git a/lib/memex_web/components/core_components.ex b/lib/memex_web/components/core_components.ex index 8120fd8..ecc9bff 100644 --- a/lib/memex_web/components/core_components.ex +++ b/lib/memex_web/components/core_components.ex @@ -136,6 +136,7 @@ defmodule MemexWeb.CoreComponents do """ end + attr :id, :string, required: true attr :datetime, :any, required: true, doc: "A `DateTime` struct or nil" @doc """ @@ -151,6 +152,7 @@ defmodule MemexWeb.CoreComponents do defp cast_datetime(_datetime), do: "" + attr :id, :string, required: true attr :date, :any, required: true, doc: "A `Date` struct or nil" @doc """ diff --git a/lib/memex_web/components/core_components/date.html.heex b/lib/memex_web/components/core_components/date.html.heex index 56d1ca3..9240afa 100644 --- a/lib/memex_web/components/core_components/date.html.heex +++ b/lib/memex_web/components/core_components/date.html.heex @@ -1,4 +1,4 @@ -