Fix date range calculations when interval >1 year

Let's consider the total number of months when doing date calculations
Merge pull request #1543 from mlocati/fix-datearchive-months-calculations

Fix date range calculations when interval >1 year