diff --git a/GitTime/Sources/Models/Event.swift b/GitTime/Sources/Models/Event.swift index 8998093..4a3a3f4 100644 --- a/GitTime/Sources/Models/Event.swift +++ b/GitTime/Sources/Models/Event.swift @@ -73,8 +73,7 @@ struct Event: ModelType { repo = try container.decode(RepositoryInfo.self, forKey: .repo) isPublic = try container.decode(Bool.self, forKey: .isPublic) let dateString = try container.decode(String.self, forKey: .createdAt) - let df = DateFormatter() - df.dateFormat = "yyyy-MM-dd'T'HH:mm:ssZ" + let df = ISO8601DateFormatter() createdAt = df.date(from: dateString) ?? Date() switch type { diff --git a/GitTime/Sources/Models/Payload.swift b/GitTime/Sources/Models/Payload.swift index cfecffa..1da74c6 100644 --- a/GitTime/Sources/Models/Payload.swift +++ b/GitTime/Sources/Models/Payload.swift @@ -259,8 +259,7 @@ struct Comment: ModelType { body = try container.decode(String.self, forKey: .body) let dateString = try container.decode(String.self, forKey: .createdAt) - let df = DateFormatter() - df.dateFormat = "yyyy-MM-dd'T'HH:mm:ssZ" + let df = ISO8601DateFormatter() createdAt = df.date(from: dateString) ?? Date() }