CoreOffice / XMLCoder

Easy XML parsing using Codable protocols in Swift
https://coreoffice.github.io/XMLCoder/
MIT License
795 stars 107 forks source link

ISO8061 date formatting isn't working #213

Open CineDev opened 3 years ago

CineDev commented 3 years ago

I got an XML with dates formatted with ISO8061, but the XMLCoder can't decode them. I've tried to user the ISO8601DateFormatter and, by itself, it does the job well. But I can't pass it to the XMLDecoder like this: decoder.dateDecodingStrategy = .formatted(ISO8601formatter) That's because you've restricted the . formatted case to a DateFormatter class instead of Formatter protocol. Please, fix that. So It would be easy to decode dates in the custom format like this: 2021-02-13 07:40:35 +0200