mirror of
https://github.com/cappuccino/cappuccino.git
synced 2026-11-13 10:13:50 +00:00
fix CPDate isEqual: and isEqualToDate:
This commit is contained in:
1 parent
2a4d3507b8
commit
564668587c
1 file changed
+11
-2
+11
-2
@@ -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
|
||||
|
||||
Reference in new issue
Block a user