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

Handle DateTime fields through Repo #81

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

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