Closed cerupcat closed 4 years ago
I'm not sure if Date.encode() via the extension is supposed to be called, but it doesn't appear to be in my case.
I have got the same issue, did you find a way to fix this without modifying the framework?
Otherwise I will probably submit a pull request for a dateEncoder
in the same way we already have a dateDecoder
Thanks for the PR @jrcmramos. This will allow customization on a request basis. Would a good default be for the default JSONEncoder to use API.dateEncodingFormatter
as well? It's used when dates are encoded as strings, but not within json bodies at the moment
Thank you for the feedback @yonaskolb. That's a really good suggestion, I will adjust the PR
I'm trying to send a DateTime as a paramter. The server is expecting a date formatted string, but instead, it's sending the
timeIntervalSinceReferenceDate
integer instead. I'm not sure where to find the encoding of the DateTime => string.