Merge remote branch 'klaaspieter/fix-758-cpdate-isequal'

This commit is contained in:
Ross Boucher committed 2010-07-21 15:04:10 -07:00
commit 709a9b3c61
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 || self > aDate);
}
- (CPComparisonResult)compare:(CPDate)anotherDate