I try to get variable from a form to add dates to current date. I get the number, but the outcome date is way off. If I hardcore the number it works fine and when I try to display the variable it gets right.
Why does it not display the right date?
$("input[name='newDate']").on('ifClicked',function addDays(date,days) {
var today = new Date();
var numberOfDaysToAdd = this.value;
today.setDate(today.getDate() + (numberOfDaysToAdd));
alert(today +'value: ' + numberOfDaysToAdd);
});