Thanks for this! There's a small bug though: If your dates are Feb 10, 2014 - Feb 10, 2015, the result will be incorrect. You need to change
if from_date.month == until_date.month
to
if from_date.month == until_date.month && from_date.year == until_date.year
Thanks for this! There's a small bug though: If your dates are Feb 10, 2014 - Feb 10, 2015, the result will be incorrect. You need to change
to