Getting Overlapping Start and End Date

前端 未结 4 1459
情书的邮戳
情书的邮戳 2021-01-28 09:13

Given a DateRange I need to return a list of Start and EndDates that overlaps the given period.

what is the best way to do it? Thanks for your time in advance.

4条回答
  •  抹茶落季
    2021-01-28 09:48

    One method would be to make use of the Rectangle class to calculate intersects. So the procedure would be to create a rectangle for each date range then use the Rectangle.Intersect( ) method.

提交回复
热议问题