Is this really Java or javascript? It looks like the latter to me.
function addNewDateFrom(){
var numberToAddafter = 0;
var toTime = new date();
toTime.setDate(toTime.getDate() + numberToAddafter++);
}
You start each time with a new (zero) value in
numberToAddafter
, and since this is a local variable, incrementing it to 1 after you add it to the time, serves no purpose, as the variable is immediately deleted.