Skip to content

Commit 00566f8

Browse files
committed
use to_iso8601 to encoe Ecto.DateTime
1 parent 74b494a commit 00566f8

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/crudex/model.ex

+1-1
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ defmodule Crudex.Model do
6161
defp encode_fields(model, module), do: reduce_on_existing_fields(model, module, &encode_field/2)
6262

6363
defp encode_field(_, nil), do: nil
64-
defp encode_field(Ecto.DateTime, field_val), do: Ecto.DateTime.to_string(field_val)
64+
defp encode_field(Ecto.DateTime, field_val), do: Ecto.DateTime.to_iso8601(field_val)
6565
defp encode_field(Crudex.JSONBinary, field_val), do: Crudex.JSONBinary.encode(field_val)
6666
defp encode_field(_type, field_val), do: field_val
6767

0 commit comments

Comments
 (0)