I am trying to add days to a given date using javascript. I have the following code
function onChange(e) { var datepicker = $(\"#DatePicker\").val();
Date.prototype.addDays = function(days) { this.setDate(this.getDate() + days); return this; };
and in your javascript code you could call
var currentDate = new Date(); // to add 8 days to current date currentDate.addDays(8);