Rolling forward days in a calendar
I'm writing my own calendar class and one of the methods I have to supply is the ability to roll the calendar date forward or backward by a given number of days. I'm not really sure how to go about doing this.
One way I was thinking was to write a method that adds one day to the date the calendar has, then put it in a loop and call that method for the amount of days needed. So if the given number of days is 7 for example, the method that adds one day will be called 7 times in a loop. However, when I tried to code this, I wasn't too sure. Also, I can't figure out what to do when the date reaches the end of the month.
For example if you were on the 25th of may and you added 10 days. It would be the 5th of the next month.
I'm obviously not asking for anyone to write the code for me, just point me in the right direction on how to go about doing this.