Question: Need to example how to calculate the count of days in a period splited by month.
For example:

```
Wed, 25 Nov 2020 : Tue, 15 Dec 2020 => [6 (nov), 15(dec)]

```

Thank you!

Answer: 
This would be a job for `tally_by`, but that is not added to Ruby (yet?).
[tally](https://ruby-doc.org/core-2.7.0/Enumerable.html#method-i-tally) works too:

```
require 'date'

range = Date.parse("Wed, 25 Nov 2020") .. Date.parse("Tue, 15 Dec 2020")
p month_counts = range.map{|d| Date::ABBR_MONTHNAMES[d.month] }.tally
# => {"Nov"=>6, "Dec"=>15}

```
```
date1 = Date.new(2020, 11, 25)
date2 = Date.new(2020, 12, 15)
(date1..date2).group_by { |date| [date.year, date.month] }
              .map { |(year, month), dates| ["#{year}/#{month}", dates.length] }

 => [["2020/11", 6], ["2020/12", 15]] 

```

What about the interval is so long that you have same months but of different years? I've added years because of this case.

This works in pure ruby too, you just need `require 'date'`