Skip to content

Commit

Permalink
Upgrade Timex to 2.x
Browse files Browse the repository at this point in the history
  • Loading branch information
Callum Barratt committed Jun 20, 2016
1 parent a58fb93 commit 4669c45
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions lib/mix/tasks/api.ex
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,8 @@ defmodule Mix.Tasks.Api do
end

def format_date(%{"date" => date}) do
DateFormat.parse!("2015/#{date}", "{YYYY}/{0M}/{0D}")
|> DateFormat.format!("%d %B %Y", :strftime)
Timex.parse!("2015/#{date}", "{YYYY}/{0M}/{0D}")
|> Timex.format!("%d %B %Y", :strftime)
end

@doc """
Expand Down
2 changes: 1 addition & 1 deletion mix.exs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ defmodule Callum.Mixfile do
{:gettext, "~> 0.9"},
{:httpoison, "~> 0.8.3"},
{:hackney, "~> 1.6.0", override: true},
{:timex, "~> 1.0.0"},
{:timex, "~> 2.1"},
{:cowboy, "~> 1.0"},
{:ex_machina, "~> 0.6.1", only: :test}
]
Expand Down
6 changes: 3 additions & 3 deletions mix.lock
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
%{"certifi": {:hex, :certifi, "0.4.0", "a7966efb868b179023618d29a407548f70c52466bf1849b9e8ebd0e34b7ea11f", [:rebar3], []},
"combine": {:hex, :combine, "0.7.0", "2ac6ae852a9835fe8189af18121cddd5bed2677f5df706dc0d208af668ab845d", [:mix], []},
"combine": {:hex, :combine, "0.8.0", "390fe5f632a8c890d378abc697ca7c4c52cd3e38bb232a5cad1677cd4af013df", [:mix], []},
"connection": {:hex, :connection, "1.0.2", "f4a06dd3ecae4141aa66f94ce92ea4c4b8753069472814932f1cadbc3078ab80", [:mix], []},
"cowboy": {:hex, :cowboy, "1.0.4", "a324a8df9f2316c833a470d918aaf73ae894278b8aa6226ce7a9bf699388f878", [:rebar, :make], [{:cowlib, "~> 1.0.0", [hex: :cowlib, optional: false]}, {:ranch, "~> 1.0", [hex: :ranch, optional: false]}]},
"cowlib": {:hex, :cowlib, "1.0.2", "9d769a1d062c9c3ac753096f868ca121e2730b9a377de23dec0f7e08b1df84ee", [:make], []},
Expand All @@ -25,5 +25,5 @@
"ranch": {:hex, :ranch, "1.2.1", "a6fb992c10f2187b46ffd17ce398ddf8a54f691b81768f9ef5f461ea7e28c762", [:make], []},
"ssl_verify_fun": {:hex, :ssl_verify_fun, "1.1.0", "edee20847c42e379bf91261db474ffbe373f8acb56e9079acb6038d4e0bf414f", [:rebar, :make], []},
"ssl_verify_hostname": {:hex, :ssl_verify_hostname, "1.0.5"},
"timex": {:hex, :timex, "1.0.1", "889ba9b9ea615e2d1e0acb7a5b0dcd8cc4e04058569dc5d4c200d86c374e90ea", [:mix], [{:tzdata, "~> 0.1.8 or ~> 0.5", [hex: :tzdata, optional: false]}, {:combine, "~> 0.7", [hex: :combine, optional: false]}]},
"tzdata": {:hex, :tzdata, "0.5.6", "d44c59175b8e9a170b3b17d6933820de98a3f0932f3a0615d884b8c20e93a87a", [:mix], [{:hackney, "~> 1.0", [hex: :hackney, optional: false]}]}}
"timex": {:hex, :timex, "2.1.6", "2c59cd03074bccea47acd668c4dd6aad269879bcc9d6d4dd98fe0ffbaf48fcaa", [:mix], [{:gettext, "~> 0.10", [hex: :gettext, optional: false]}, {:combine, "~> 0.7", [hex: :combine, optional: false]}, {:tzdata, "~> 0.1.8 or ~> 0.5", [hex: :tzdata, optional: false]}]},
"tzdata": {:hex, :tzdata, "0.5.8", "a4ffe564783c6519e4df230a5d0e1cf44b7db7f576bcae76d05540b5da5b6143", [:mix], [{:hackney, "~> 1.0", [hex: :hackney, optional: false]}]}}
2 changes: 1 addition & 1 deletion web/views/page_view.ex
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ defmodule Callum.PageView do
end

def calories(intake) do
date = Date.now |> DateFormat.format!("%d %B %Y", :strftime)
date = DateTime.today |> Timex.format!("%d %B %Y", :strftime)

if intake.logged_date == date do
intake.calories
Expand Down

0 comments on commit 4669c45

Please sign in to comment.