Summer time.
As you add 24 hours to the date, this is not enough to deliver you the next day on Sunday, since there is 25 hours on this special Sunday.
You should add a day instead of adding hours:
stdate = new Date(stdate.getFullYear(), stdate.getMonth(), stdate.getDate() + 1);
Explanation: When you call the Date constructor with a date that is outside the valid range, it is automatically carried over to the next month, i.e. new Date(2010,9,32) gives you the first of November.
Guffa source share