Phoenix Timex integrates Phoenix with Timex. It simply implements the Phoenix.HTML.Safe
protocol for %Timex.DateTime
and %Timex.Date
, allowing you to use them in your templates without having to pick a format.
NOTE: Phoenix Timex is only useful for Timex < 3 and Elixir < 1.3. Timex 3 uses Calendar types, wich already implement Phoenix.HTML.Safe
.
-
Add phoenix_timex to your list of dependencies in
mix.exs
:def deps do [{:phoenix_timex, "~> 1.0.0"}] end
-
Run
mix deps.get
Phoenix Timex 1.x supports Timex 2.x.
Use Phoenix Timex 0.0.3 if you want support for Timex < 2.