I want to know if Ruby has an easy way to find all the date range between two date ranges. I have two date arrays: January 01, 08:00 and January 01, 12:00 in one array, and January 01, 09:00 to January 01, 10:00 in another. I want to return an array like:
January 1, 08:00 to January 1, 09:00
and:
January 1, 10:00 to January 1, 12:00
This is one way to do it:
That sets up two arrays of dates.
Which outputs:
The two date arrays look like:
Coerce them into DateTime objects: