mirror of
https://github.com/cappuccino/cappuccino.git
synced 2026-10-27 02:25:36 +00:00
Match CPDate distantPast and distantFuture with Cocoa.
This commit is contained in:
1 parent
25763962b2
commit
d0c7796e7c
2 files changed
+12
-2
No files matched your search
+2
-2
@@ -64,12 +64,12 @@ var CPDateReferenceDate = new Date(Date.UTC(2001, 0, 1, 0, 0, 0, 0));
|
||||
|
||||
+ (id)distantPast
|
||||
{
|
||||
return new Date(-10000, 1, 1, 0, 0, 0, 0);
|
||||
return [CPDate dateWithTimeIntervalSinceReferenceDate:-63113817600.0];
|
||||
}
|
||||
|
||||
+ (id)distantFuture
|
||||
{
|
||||
return new Date(10000, 1, 1, 0, 0, 0, 0);
|
||||
return [CPDate dateWithTimeIntervalSinceReferenceDate:63113990400.0];
|
||||
}
|
||||
|
||||
- (id)initWithTimeIntervalSinceNow:(CPTimeInterval)seconds
|
||||
|
||||
@@ -10,6 +10,16 @@
|
||||
[self assertTrue:[unixDate isEqualToDate:cocoaDate] message:[unixDate description] + " isEqualToDate: " + [cocoaDate description]];
|
||||
}
|
||||
|
||||
- (void)testDistantPast
|
||||
{
|
||||
[self assert:[CPDate dateWithTimeIntervalSinceReferenceDate:-63113817600.0] equals:[CPDate distantPast]];
|
||||
}
|
||||
|
||||
- (void)testDistantFuture
|
||||
{
|
||||
[self assert:[CPDate dateWithTimeIntervalSinceReferenceDate:63113990400.0] equals:[CPDate distantFuture]];
|
||||
}
|
||||
|
||||
- (void)testDate
|
||||
{
|
||||
var before = new Date(),
|
||||
|
||||
Reference in new issue
Block a user