Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problem with Dates and Ex_admin #409

Open
morganlean opened this issue Oct 20, 2017 · 1 comment
Open

Problem with Dates and Ex_admin #409

morganlean opened this issue Oct 20, 2017 · 1 comment

Comments

@morganlean
Copy link

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

@cdesch
Copy link

cdesch commented Nov 28, 2017

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants