|
public static DateTimeRange Intersect(this DateTimeRange first, DateTimeRange second) => |
This is not an intersection, it's rather a union. Intersection is a common part of two ranges, which may ever be empty.
Since DateTimeRange Intersect(this DateTimeRange first, DateTimeRange second) API is public now, I suggest the following:
- Implement
DateTimeRange? IntersectWith(this DateTimeRange first, DateTimeRange second) which does the right thing.
- Implement
DateTimeRange CombineWith(this DateTimeRange first, DateTimeRange second) which does what current DateTimeRange Intersect(this DateTimeRange first, DateTimeRange second) does.
- Drop the
DateTimeRange Intersect(this DateTimeRange first, DateTimeRange second) method, pushing the major library number, so that people would expect breakage upon version change.
I can do this if you agree on this direction.
DateTimeRange/src/DateTimeRange/DateTimeRangeExtensions.cs
Line 19 in 6ffc794
This is not an intersection, it's rather a union. Intersection is a common part of two ranges, which may ever be empty.
Since
DateTimeRange Intersect(this DateTimeRange first, DateTimeRange second)API is public now, I suggest the following:DateTimeRange? IntersectWith(this DateTimeRange first, DateTimeRange second)which does the right thing.DateTimeRange CombineWith(this DateTimeRange first, DateTimeRange second)which does what currentDateTimeRange Intersect(this DateTimeRange first, DateTimeRange second)does.DateTimeRange Intersect(this DateTimeRange first, DateTimeRange second)method, pushing the major library number, so that people would expect breakage upon version change.I can do this if you agree on this direction.