From 991bfe9eb28f45aa1b85bba954ae6564c709e368 Mon Sep 17 00:00:00 2001 From: levin Date: Sat, 19 Oct 2024 15:57:07 +0000 Subject: [PATCH] new date format --- fly.toml | 6 +++--- lib/algground_web/live/pages/live_home_page.ex | 6 +++--- mix.exs | 3 ++- mix.lock | 2 ++ 4 files changed, 10 insertions(+), 7 deletions(-) diff --git a/fly.toml b/fly.toml index 797205b..38cd800 100644 --- a/fly.toml +++ b/fly.toml @@ -1,9 +1,9 @@ -# fly.toml app configuration file generated for algground on 2024-10-19T10:38:07Z +# fly.toml app configuration file generated for aww on 2024-10-19T15:46:50Z # # See https://fly.io/docs/reference/configuration/ for information about how to use this file. # -app = 'algground' +app = 'aww' primary_region = 'mad' kill_signal = 'SIGTERM' @@ -13,7 +13,7 @@ kill_signal = 'SIGTERM' release_command = '/app/bin/migrate' [env] - PHX_HOST = 'algground.fly.dev' + PHX_HOST = 'aww.fly.dev' PORT = '8080' [http_service] diff --git a/lib/algground_web/live/pages/live_home_page.ex b/lib/algground_web/live/pages/live_home_page.ex index d801ebd..5318a5b 100644 --- a/lib/algground_web/live/pages/live_home_page.ex +++ b/lib/algground_web/live/pages/live_home_page.ex @@ -35,7 +35,7 @@ defmodule AlggroundWeb.LiveHomePage do {:ok, socket - |> assign(:date, Date.utc_today()) + |> assign(:date, Datex.Date.today()) |> assign(:regions, regions) |> assign(:groundwater, trunc(:rand.uniform() * 100)) |> assign(:rainfall, trunc(:rand.uniform() * 100)) @@ -58,7 +58,7 @@ defmodule AlggroundWeb.LiveHomePage do {:noreply, socket |> assign(:regions, regions) - |> assign(:date, Date.add(socket.assigns.date, 31)) + |> assign(:date, Datex.Date.add(socket.assigns.date, 31)) |> assign(:groundwater, trunc(:rand.uniform() * 100)) |> assign(:rainfall, trunc(:rand.uniform() * 100)) |> assign(:reservoirs, trunc(:rand.uniform() * 10_000_000))} @@ -70,7 +70,7 @@ defmodule AlggroundWeb.LiveHomePage do

- <%= @date %> + <%= Datex.Date.format_date(@date, "DD/MM/YYYY") %>

Albufeira diff --git a/mix.exs b/mix.exs index 13a5d36..f1248dd 100644 --- a/mix.exs +++ b/mix.exs @@ -58,7 +58,8 @@ defmodule Algground.MixProject do {:gettext, "~> 0.20"}, {:jason, "~> 1.2"}, {:dns_cluster, "~> 0.1.1"}, - {:bandit, "~> 1.5"} + {:bandit, "~> 1.5"}, + {:datex, "~> 1.0"} ] end diff --git a/mix.lock b/mix.lock index 0523b32..308c0b0 100644 --- a/mix.lock +++ b/mix.lock @@ -1,6 +1,8 @@ %{ "bandit": {:hex, :bandit, "1.5.7", "6856b1e1df4f2b0cb3df1377eab7891bec2da6a7fd69dc78594ad3e152363a50", [:mix], [{:hpax, "~> 1.0.0", [hex: :hpax, repo: "hexpm", optional: false]}, {:plug, "~> 1.14", [hex: :plug, repo: "hexpm", optional: false]}, {:telemetry, "~> 0.4 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}, {:thousand_island, "~> 1.0", [hex: :thousand_island, repo: "hexpm", optional: false]}, {:websock, "~> 0.5", [hex: :websock, repo: "hexpm", optional: false]}], "hexpm", "f2dd92ae87d2cbea2fa9aa1652db157b6cba6c405cb44d4f6dd87abba41371cd"}, "castore": {:hex, :castore, "1.0.9", "5cc77474afadf02c7c017823f460a17daa7908e991b0cc917febc90e466a375c", [:mix], [], "hexpm", "5ea956504f1ba6f2b4eb707061d8e17870de2bee95fb59d512872c2ef06925e7"}, + "datex": {:hex, :datex, "1.0.0", "29478d01fd394c6d785bba8d6e79cdd74fee3ae518ccb3ac5fc759a53ea715e2", [:mix], [], "hexpm", "863d1686796e30563613051783723f3ece74f2d84e2d3df2c70b834271586f11"}, + "datix": {:hex, :datix, "0.3.2", "fac7ef37c3de1f535f8f2cce511e2948e72005781661c77e26fb421191724e7f", [:mix], [], "hexpm", "0ed482f82e07c8094a2ee89a00c25ceb18909213730c2d4cb3c21b07f72d0539"}, "db_connection": {:hex, :db_connection, "2.7.0", "b99faa9291bb09892c7da373bb82cba59aefa9b36300f6145c5f201c7adf48ec", [:mix], [{:telemetry, "~> 0.4 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "dcf08f31b2701f857dfc787fbad78223d61a32204f217f15e881dd93e4bdd3ff"}, "decimal": {:hex, :decimal, "2.1.1", "5611dca5d4b2c3dd497dec8f68751f1f1a54755e8ed2a966c2633cf885973ad6", [:mix], [], "hexpm", "53cfe5f497ed0e7771ae1a475575603d77425099ba5faef9394932b35020ffcc"}, "dns_cluster": {:hex, :dns_cluster, "0.1.3", "0bc20a2c88ed6cc494f2964075c359f8c2d00e1bf25518a6a6c7fd277c9b0c66", [:mix], [], "hexpm", "46cb7c4a1b3e52c7ad4cbe33ca5079fbde4840dedeafca2baf77996c2da1bc33"},