If I then pass ecto_date into Timex.Ecto.Date.load I receive an :error
Looking at the code for Timex.Ecto.Date.load it's pattern matching on {_year, _month, _date}, which is not the standard Ecto date format, but is instead the erl format.
Either the function should be updated so that it's parameter is %Ecto.Date{} = date or the documentation should be changed to reflect that it takes an erl date.
~I'd be happy to create a PR for either direction.~
In iex, if I get a new Ecto.Date by calling:
ecto_date = Ecto.Date.utc()
It returns
#Ecto.Date<2017-02-12>
If I then pass
ecto_date
intoTimex.Ecto.Date.load
I receive an:error
Looking at the code for
Timex.Ecto.Date.load
it's pattern matching on{_year, _month, _date}
, which is not the standard Ecto date format, but is instead the erl format.Either the function should be updated so that it's parameter is
%Ecto.Date{} = date
or the documentation should be changed to reflect that it takes an erl date.~I'd be happy to create a PR for either direction.~
Created a PR (https://github.com/bitwalker/timex_ecto/pull/60) that adds support for
Ecto.Date
and spruces up the documentation.