From d79d0fa1790595bc17339f0796daac9e3d850875 Mon Sep 17 00:00:00 2001 From: shibao Date: Wed, 23 Feb 2022 20:51:42 -0500 Subject: [PATCH] use today's date when adding new shot groups --- CHANGELOG.md | 1 + .../components/add_shot_group_component.html.heex | 6 +++++- priv/gettext/actions.pot | 2 +- priv/gettext/prompts.pot | 2 +- 4 files changed, 8 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9262bfa3..928d0ce5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,7 @@ - Fix ammo type counts not showing when count is 0 - Add prompt to create first container before first ammo group - Edit and delete shot groups from ammo group show page +- Use today's date when adding new shot groups # v0.2.3 - Fix modals with overflowing forms diff --git a/lib/cannery_web/components/add_shot_group_component.html.heex b/lib/cannery_web/components/add_shot_group_component.html.heex index a1b16032..79fa8b3a 100644 --- a/lib/cannery_web/components/add_shot_group_component.html.heex +++ b/lib/cannery_web/components/add_shot_group_component.html.heex @@ -36,7 +36,11 @@ <%= error_tag(f, :notes, "col-span-3") %> <%= label(f, :date, gettext("Date (UTC)"), class: "title text-lg text-primary-600") %> - <%= date_input(f, :date, class: "input input-primary col-span-2") %> + <%= date_input(f, :date, + class: "input input-primary col-span-2", + phx_update: "ignore", + value: Date.utc_today() + ) %> <%= error_tag(f, :notes, "col-span-3") %> <%= submit(dgettext("actions", "Save"), diff --git a/priv/gettext/actions.pot b/priv/gettext/actions.pot index 5f4c0cce..5557e589 100644 --- a/priv/gettext/actions.pot +++ b/priv/gettext/actions.pot @@ -124,7 +124,7 @@ msgid "Reset password" msgstr "" #, elixir-autogen, elixir-format -#: lib/cannery_web/components/add_shot_group_component.html.heex:42 +#: lib/cannery_web/components/add_shot_group_component.html.heex:46 #: lib/cannery_web/live/ammo_group_live/form_component.html.heex:54 #: lib/cannery_web/live/ammo_type_live/form_component.html.heex:156 #: lib/cannery_web/live/container_live/form_component.html.heex:50 diff --git a/priv/gettext/prompts.pot b/priv/gettext/prompts.pot index a159265c..62f6964b 100644 --- a/priv/gettext/prompts.pot +++ b/priv/gettext/prompts.pot @@ -159,7 +159,7 @@ msgid "Register to setup %{name}" msgstr "" #, elixir-autogen, elixir-format -#: lib/cannery_web/components/add_shot_group_component.html.heex:44 +#: lib/cannery_web/components/add_shot_group_component.html.heex:48 #: lib/cannery_web/live/ammo_group_live/form_component.html.heex:55 #: lib/cannery_web/live/ammo_type_live/form_component.html.heex:157 #: lib/cannery_web/live/container_live/form_component.html.heex:52