File tree 2 files changed +4
-3
lines changed
Source/Shared/DataStructures
Tests/iOS/Specs/DataStructures
2 files changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -10,7 +10,8 @@ public enum Expiry {
10
10
11
11
switch self {
12
12
case . Never:
13
- result = NSDate . distantFuture ( )
13
+ // Ref: http://lists.apple.com/archives/cocoa-dev/2005/Apr/msg01833.html
14
+ result = NSDate ( timeIntervalSince1970: 60 * 60 * 24 * 365 * 68 )
14
15
case . Seconds( let seconds) :
15
16
result = NSDate ( ) . dateByAddingTimeInterval ( seconds)
16
17
case . Date( let date) :
@@ -19,4 +20,4 @@ public enum Expiry {
19
20
20
21
return result
21
22
}
22
- }
23
+ }
Original file line number Diff line number Diff line change @@ -10,7 +10,7 @@ class ExpirySpec: QuickSpec {
10
10
11
11
describe ( " #date " ) {
12
12
it ( " returns date in the distant future " ) {
13
- let date = NSDate . distantFuture ( )
13
+ let date = NSDate ( timeIntervalSince1970 : 60 * 60 * 24 * 365 * 68 )
14
14
expiry = . Never
15
15
16
16
expect ( expiry. date) . to ( equal ( date) )
You can’t perform that action at this time.
0 commit comments