I want to have something like this:
By example: If the first date is 2012-02-01 (YYYY-MM-DD), the next date has to be 2012-03-01. So increment the month.
However, if the date is 2012-12-01, the next date has to be 2013-01-01. I have managed to that doing nextMonth=((thisMonth) mod 12)+1 and setting nextYear to thisYear+1 if thisMonth = 12.
My question is: Can I do that easily using the Date library?
You can use Date#>>:
If the start date is not the first of the month but you still need the end date to be the first of the following month, you can do this: