How to combine overlapping time ranges (time ranges union)

后端 未结 10 1398
渐次进展
渐次进展 2020-12-08 05:19

I have an array with several time ranges inside:

[Tue, 24 May 2011 08:00:00 CEST +02:00..Tue, 24 May 2011 13:00:00 CEST +02:00,
 Tue, 24 May 2011 16:30:00 CE         


        
10条回答
  •  一个人的身影
    2020-12-08 05:52

    The facets gem has Range.combine method that may be of use: http://rdoc.info/github/rubyworks/facets/master/Range#combine-instance_method

提交回复
热议问题