ex_admin
ex_admin copied to clipboard
Problem with Dates and Ex_admin
Hi,
I changed the dependancy of my ecto to this older version but now I'm getting this error. Is there a way to use newer ecto with ex_admin.
== Compilation error on file web/models/post.ex == ** (ArgumentError) invalid or unknown type :date for field :date_published. Maybe you meant to use Ecto.Date? lib/ecto/schema.ex:1486: Ecto.Schema.raise_type_error/2 lib/ecto/schema.ex:1206: Ecto.Schema.field/4 web/models/post.ex:12: (module) (stdlib) erl_eval.erl:670: :erl_eval.do_apply/6 (elixir) lib/kernel/parallel_compiler.ex:117: anonymous fn/4 in Kernel.ParallelCompiler.spawn_compilers/1
Try something like this on the form
input user, :birthdate, options: [year: [prompt: "Year"], month: [prompt: "Month"], day: [prompt: "Day"]]
And this on the schema:
field :birthdate, Ecto.Date