From 79b152dfa3aa6c0a69d3ae7210857d704aac6faf Mon Sep 17 00:00:00 2001 From: znek Date: Thu, 16 Dec 2004 14:21:47 +0000 Subject: [PATCH] -containsDateRange: convenience method added git-svn-id: http://svn.opengroupware.org/SOPE/trunk@448 e4a50df8-12e2-0310-a44c-efbce7f8a7e3 --- sope-core/NGExtensions/ChangeLog | 5 +++++ sope-core/NGExtensions/NGCalendarDateRange.m | 13 +++++++++++++ .../NGExtensions/NGExtensions/NGCalendarDateRange.h | 1 + sope-core/NGExtensions/Version | 2 +- 4 files changed, 20 insertions(+), 1 deletion(-) diff --git a/sope-core/NGExtensions/ChangeLog b/sope-core/NGExtensions/ChangeLog index 0cbf6279..94055a7b 100644 --- a/sope-core/NGExtensions/ChangeLog +++ b/sope-core/NGExtensions/ChangeLog @@ -1,3 +1,8 @@ +2004-12-16 Marcus Mueller + + * NGCalendarDateRange.[hm]: new convenience method -containsDateRange: + (v4.5.140) + 2004-12-14 Marcus Mueller * NGExtensions.xcode: minor fixes and updated diff --git a/sope-core/NGExtensions/NGCalendarDateRange.m b/sope-core/NGExtensions/NGCalendarDateRange.m index 1c3e9dcf..31d0eb2e 100644 --- a/sope-core/NGExtensions/NGCalendarDateRange.m +++ b/sope-core/NGExtensions/NGCalendarDateRange.m @@ -130,6 +130,19 @@ [self->endDate compare:date] == NSOrderedDescending) ? YES : NO; } +- (BOOL)containsDateRange:(NGCalendarDateRange *)_range { + NSComparisonResult result; + + result = [self->startDate compare:[_range startDate]]; + if (!((result == NSOrderedSame) || (result == NSOrderedAscending))) + return NO; + result = [self->endDate compare:[_range endDate]]; + if (result == NSOrderedAscending) + return NO; + return YES; +} + + /* comparison */ - (BOOL)isEqual:(id)other { diff --git a/sope-core/NGExtensions/NGExtensions/NGCalendarDateRange.h b/sope-core/NGExtensions/NGExtensions/NGCalendarDateRange.h index 37600647..9b6be159 100644 --- a/sope-core/NGExtensions/NGExtensions/NGCalendarDateRange.h +++ b/sope-core/NGExtensions/NGExtensions/NGCalendarDateRange.h @@ -56,6 +56,7 @@ - (BOOL)doesIntersectWithDateRange:(NGCalendarDateRange *)_other; - (BOOL)containsDate:(NSCalendarDate *)date; +- (BOOL)containsDateRange:(NGCalendarDateRange *)_range; @end diff --git a/sope-core/NGExtensions/Version b/sope-core/NGExtensions/Version index bc7a0732..c0e8b131 100644 --- a/sope-core/NGExtensions/Version +++ b/sope-core/NGExtensions/Version @@ -1,6 +1,6 @@ # version -SUBMINOR_VERSION:=139 +SUBMINOR_VERSION:=140 # v4.3.115 requires libFoundation v1.0.59 # v4.2.72 requires libEOControl v4.2.39 -- 2.39.5