dlex icon indicating copy to clipboard operation
dlex copied to clipboard

Handle DateTime fields through Repo

Open mangr3n opened this issue 5 years ago • 0 comments

I don't know if I did this the right way, but as is the Repo.set and Repo.get functions were not handling :datetime attributes

The first change was to use an Ecto.Type that exists. :utc_datetime is the Ecto type that matches.

Dgraph encodes datetime attributes as rfc3339. I did not find a native rfc3339 parsing/formatting library so I brought int Calendar 1.0

Finally, I modified decoding and encoding fields to turn DateTime structs into rfc3339 strings and :utc_datetime rfc3339 strings into DateTime structs

I need these changes to continue to move forward using this library in my project.

mangr3n avatar Jun 17 '20 10:06 mangr3n