You could extend the javascript Date object like this
Date.prototype.addDays = function(days) {
this.setDate(this.getDate() + parseInt(days));
return this;
};
and in your javascript code you could call
var currentDate = new Date();
// to add 4 days to current date
currentDate.addDays(4);