Use `ISO8601DateFormatter`
This commit is contained in:
parent
28df34d300
commit
3cbf95efbf
|
@ -22,12 +22,13 @@ extension Timeline: CustomStringConvertible {
|
||||||
|
|
||||||
/// A textual representation of this timeline.
|
/// A textual representation of this timeline.
|
||||||
public var description: String {
|
public var description: String {
|
||||||
let f = DateFormatter()
|
enum Cache {
|
||||||
f.dateFormat = "yyyy-MM-dd HH:mm:ss.SSS"
|
static let fmt = ISO8601DateFormatter()
|
||||||
|
}
|
||||||
|
|
||||||
let desc = { (d: Date?) -> String in
|
let desc = { (d: Date?) -> String in
|
||||||
guard let d = d else { return "nil" }
|
guard let d = d else { return "nil" }
|
||||||
return f.string(from: d)
|
return Cache.fmt.string(from: d)
|
||||||
}
|
}
|
||||||
|
|
||||||
return "Timeline: { " +
|
return "Timeline: { " +
|
||||||
|
|
Loading…
Reference in New Issue