Skip to content

Conversation

@mangr3n
Copy link

@mangr3n mangr3n commented Jun 17, 2020

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.

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

Successfully merging this pull request may close these issues.

1 participant