Use correct ISO 8601 date decoder

This commit is contained in:
Shadowfacts 2019-09-24 14:53:35 -04:00
parent 6225b2a02f
commit 5da357ee9c
Signed by: shadowfacts
GPG Key ID: 94A5AB95422746E5
1 changed files with 1 additions and 5 deletions

View File

@ -28,11 +28,7 @@ public class Client {
lazy var decoder: JSONDecoder = {
let decoder = JSONDecoder()
let formatter = DateFormatter()
formatter.dateFormat = "yyyy-MM-dd'T'HH:mm:ss.SZ"
formatter.timeZone = TimeZone(abbreviation: "UTC")
formatter.locale = Locale(identifier: "en_US_POSIX")
decoder.dateDecodingStrategy = .formatted(formatter)
decoder.dateDecodingStrategy = .iso8601
return decoder
}()