fix CPDate isEqual: and isEqualToDate:

This commit is contained in:
Klaas Pieter Annema committed 2010-07-15 14:42:48 +02:00
1 parent 2a4d3507b8
commit 564668587c
1 file changed
+11 -2
+11 -2
View File
@@ -148,12 +148,21 @@ var CPDateReferenceDate = new Date(Date.UTC(2001, 1, 1, 0, 0, 0, 0));
- (BOOL)isEqual:(CPDate)aDate
{
if (self === aDate)
return YES;
if (!aDate || ![aDate isKindOfClass:[CPDate class]])
return NO;
return [self isEqualToDate:aDate];
}
- (BOOL)isEqualToDate:(CPDate)anotherDate
- (BOOL)isEqualToDate:(CPDate)aDate
{
return self === anotherDate || (anotherDate !== nil && anotherDate.isa && [anotherDate isKindOfClass:CPDate] && !(self < anotherDate || self > anotherDate));
if (!aDate)
return NO;
return self === aDate;
}
- (CPComparisonResult)compare:(CPDate)anotherDate