Use correct ISO 8601 date decoder
This commit is contained in:
parent
6225b2a02f
commit
5da357ee9c
|
@ -28,11 +28,7 @@ public class Client {
|
||||||
|
|
||||||
lazy var decoder: JSONDecoder = {
|
lazy var decoder: JSONDecoder = {
|
||||||
let decoder = JSONDecoder()
|
let decoder = JSONDecoder()
|
||||||
let formatter = DateFormatter()
|
decoder.dateDecodingStrategy = .iso8601
|
||||||
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)
|
|
||||||
return decoder
|
return decoder
|
||||||
}()
|
}()
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue