-
Notifications
You must be signed in to change notification settings - Fork 47
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
Invalid encoder for Date
#38
Comments
something like |
make that charles-cooper@2a0259b |
i guess an issue that needs to be cleared up is that Elm's Date technically corresponds to Haskell's https://hackage.haskell.org/package/time-1.8.0.1/docs/Data-Time-LocalTime.html since it includes a non-timezoned time of day. the two paths i suggest going forward are to only maintain an ElmType instance for Data.Time.LocalTime OR for Data.Time.Calendar.Day, but not both - that way it forces the user to be careful about marshalling to the correct type. |
I've just run into this too. In my case I was using a data type with a Ideally, I'd like to be able to just reuse my Haskell type as it is without being forced into using specific types. I'm not sure what the best option is though. |
I think the JSON encoder for
Date
is not compatible with Aeson. It uses thetoString
method which producesbut aeson is expecting an ISO8601 date
https://hackage.haskell.org/package/aeson-1.1.1.0/src/Data/Aeson/Parser/Time.hs#day
I'm happy to submit a pull request.
The text was updated successfully, but these errors were encountered: