Skip to content

Commit

Permalink
Merge pull request #92 from 87kangsw/feature/91
Browse files Browse the repository at this point in the history
Dateformatter를 iso8601 로 변경
  • Loading branch information
87kangsw authored Jul 18, 2023
2 parents a6e52f7 + 3dd73b4 commit a29f5aa
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
3 changes: 1 addition & 2 deletions GitTime/Sources/Models/Event.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
3 changes: 1 addition & 2 deletions GitTime/Sources/Models/Payload.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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()
}

Expand Down

0 comments on commit a29f5aa

Please sign in to comment.