Skip to content

Commit

Permalink
Merge pull request #161 from j-gao/master
Browse files Browse the repository at this point in the history
Handle timestamp in microseconds
  • Loading branch information
sbertix authored Mar 24, 2020
2 parents 873f0eb + 069b69a commit 0ef7fd1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion SwiftyInsta/Local/Responses/ThreadResponse.swift
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ public struct Message: ItemIdentifiableParsedResponse, UserIdentifiableParsedRes
public var sentAt: Date {
return rawResponse.timestamp
.double
.flatMap { $0 > 9_999_999_999 ? $0/1_000 : $0 }
.flatMap { $0 / pow(10.0, max(floor(log10($0)) - 9, 0)) }
.flatMap { Date(timeIntervalSince1970: $0) } ?? .distantPast
}
/// The `text` value.
Expand Down

0 comments on commit 0ef7fd1

Please sign in to comment.