1
0
mirror of https://github.com/danbee/chess synced 2025-03-04 08:39:06 +00:00

Fix datetime formatting

This commit is contained in:
Daniel Barber 2016-12-09 16:38:25 +00:00
parent 6291cbbff0
commit 2c7e97c697
5 changed files with 7 additions and 4 deletions

View File

@ -19,7 +19,7 @@ defmodule Chess.Mixfile do
def application do
[mod: {Chess, []},
applications: [:phoenix, :phoenix_pubsub, :phoenix_html, :cowboy, :logger, :gettext,
:phoenix_ecto, :postgrex]]
:phoenix_ecto, :postgrex, :timex_ecto]]
end
# Specifies which paths to compile per environment.
@ -38,7 +38,7 @@ defmodule Chess.Mixfile do
{:phoenix_live_reload, "~> 1.0", only: :dev},
{:gettext, "~> 0.11"},
{:cowboy, "~> 1.0"},
{:timex, "~> 3.1"}]
{:timex_ecto, "~> 3.0"}]
end
# Aliases are shortcuts or tasks specific to the current project.

View File

@ -25,4 +25,5 @@
"ranch": {:hex, :ranch, "1.2.1", "a6fb992c10f2187b46ffd17ce398ddf8a54f691b81768f9ef5f461ea7e28c762", [:make], []},
"ssl_verify_fun": {:hex, :ssl_verify_fun, "1.1.1", "28a4d65b7f59893bc2c7de786dec1e1555bd742d336043fe644ae956c3497fbe", [:make, :rebar], []},
"timex": {:hex, :timex, "3.1.5", "413d6d8d6f0162a5d47080cb8ca520d790184ac43e097c95191c7563bf25b428", [], [{:combine, "~> 0.7", [hex: :combine, optional: false]}, {:gettext, "~> 0.10", [hex: :gettext, optional: false]}, {:tzdata, "~> 0.1.8 or ~> 0.5", [hex: :tzdata, optional: false]}]},
"timex_ecto": {:hex, :timex_ecto, "3.0.5", "3ec6c25e10d2c0020958e5df64d2b5e690e441faa2c2259da8bc6bd3d7f39256", [:mix], [{:ecto, "~> 2.0", [hex: :ecto, optional: false]}, {:timex, "~> 3.0", [hex: :timex, optional: false]}]},
"tzdata": {:hex, :tzdata, "0.5.9", "575be217b039057a47e133b72838cbe104fb5329b19906ea4e66857001c37edb", [:mix], [{:hackney, "~> 1.0", [hex: :hackney, optional: false]}]}}

View File

@ -4,7 +4,7 @@ defmodule Chess.Game do
schema "games" do
field :board, :map
timestamps()
timestamps
end
@doc """

View File

@ -5,7 +5,7 @@
<%= for game <- @games do %>
<tr>
<td>
<%= link "Started on #{Timex.format!(game.inserted_at, "%b %e at %I:%M%P", :strftime)}", to: game_path(@conn, :show, game), class: "btn btn-default btn-xs" %>
<%= link "Started on #{Timex.format!(game.inserted_at, "%b %e at %I:%M %P", :strftime)}", to: game_path(@conn, :show, game), class: "btn btn-default btn-xs" %>
</td>
<td class="text-right">
<%= link "Delete", to: game_path(@conn, :delete, game), method: :delete, data: [confirm: "Are you sure?"], class: "btn btn-danger btn-xs" %>

View File

@ -20,6 +20,8 @@ defmodule Chess.Web do
quote do
use Ecto.Schema
use Timex.Ecto.Timestamps
import Ecto
import Ecto.Changeset
import Ecto.Query