Closed cerupcat closed 5 years ago
Hi @cerupcat.
In 4.0, DateTime
was changed to a simple Date
. You can set apiClient.jsonDecoder.dateDecodingStrategy
to choose how these are decoded. If you use .custom
you can provide your own decoder that uses multiple date formatters. That's what the default one does.
It reminds me, I should add a apiClient.jsonEncoder
as well, at the moment it just uses a new instance everytime.
Thanks @yonaskolb that's helpful. I missed seeing that jsonDecoder was public.
Keep up the great work! This is very helpful!
Previously you could override
DateTime.dateDecodingFormatters
, but I don't see an option for setting the date formats in v4.0. Is there a way to add multiple date formatting options? Right now I'm getting errors that it can't parse certain Date fields.