Chat web-app using Phoenix and Vue.js — Part 5
Jesper Christiansen

Hi all,

if anyone is using the 1.4.0+ version of Elixir and get's this error:

no function clause matching in Ecto.DateTime.to_erl/1
(ecto) lib/ecto/date_time.ex:608: Ecto.DateTime.to_erl(~N[2017-01-13 15:50:01.946747])

Just change in web/channels/room_channel.ex in date translation used in Enum function inside thehandle_info to:

"received_at" => message.inserted_at
|> NaiveDateTime.to_erl
|> :calendar.datetime_to_gregorian_seconds
|> Kernel.-(62_167_219_200)

Elixir 1.4.0 introduced the NaiveDateTime that is used as default by Ecto when dealing with PostgreSQL.

One clap, two clap, three clap, forty?

By clapping more or less, you can signal to us which stories really stand out.