- if ([b compare:d] == NSOrderedAscending)
- return [NGCalendarDateRange calendarDateRangeWithStartDate:c endDate:b];
-
+ // b ?< d
+ if ([b compare:d] == NSOrderedAscending) {
+ // c !< b && b !< d -> [c;b[
+ if([c compare:b] == NSOrderedSame)
+ return nil; // no real range, thus return nil!
+ else
+ return [NGCalendarDateRange calendarDateRangeWithStartDate:c endDate:b];
+ }
+ if([c compare:d] == NSOrderedSame)
+ return nil; // no real range, thus return nil!
+ // b !> d -> [c;d[