mirror of
https://github.com/gosticks/SwiftGit2.git
synced 2025-10-16 11:55:34 +00:00
Replace NSDate with Date wherever possible
This commit is contained in:
parent
59cccf62d0
commit
b6c3c795bc
@ -32,7 +32,7 @@ public struct Signature {
|
||||
public let email: String
|
||||
|
||||
/// The time when the action happened.
|
||||
public let time: NSDate
|
||||
public let time: Date
|
||||
|
||||
/// The time zone that `time` should be interpreted relative to.
|
||||
public let timeZone: NSTimeZone
|
||||
@ -41,7 +41,7 @@ public struct Signature {
|
||||
public init(_ signature: git_signature) {
|
||||
name = String(validatingUTF8: signature.name)!
|
||||
email = String(validatingUTF8: signature.email)!
|
||||
time = NSDate(timeIntervalSince1970: TimeInterval(signature.when.time))
|
||||
time = Date(timeIntervalSince1970: TimeInterval(signature.when.time))
|
||||
timeZone = NSTimeZone(forSecondsFromGMT: NSInteger(60 * signature.when.offset))
|
||||
}
|
||||
}
|
||||
|
||||
@ -36,7 +36,7 @@ class SignatureSpec: QuickSpec {
|
||||
|
||||
expect(signature.name).to(equal("Matt Diephouse"))
|
||||
expect(signature.email).to(equal("matt@diephouse.com"))
|
||||
expect(signature.time).to(equal(NSDate(timeIntervalSince1970: 1416186947)))
|
||||
expect(signature.time).to(equal(Date(timeIntervalSince1970: 1416186947)))
|
||||
expect(signature.timeZone.abbreviation).to(equal("GMT-5"))
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user