Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions Source/Shared/DataStructures/Expiry.swift
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ public enum Expiry {

switch self {
case .Never:
result = NSDate.distantFuture()
// Ref: http://lists.apple.com/archives/cocoa-dev/2005/Apr/msg01833.html
result = NSDate(timeIntervalSince1970: 60 * 60 * 24 * 365 * 68)
case .Seconds(let seconds):
result = NSDate().dateByAddingTimeInterval(seconds)
case .Date(let date):
Expand All @@ -19,4 +20,4 @@ public enum Expiry {

return result
}
}
}
2 changes: 1 addition & 1 deletion Tests/iOS/Specs/DataStructures/ExpirySpec.swift
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ class ExpirySpec: QuickSpec {

describe("#date") {
it("returns date in the distant future") {
let date = NSDate.distantFuture()
let date = NSDate(timeIntervalSince1970: 60 * 60 * 24 * 365 * 68)
expiry = .Never

expect(expiry.date).to(equal(date))
Expand Down