Adding days to JavaScript Date

With prototype is really easy to extend the functions of Date and add the option ADDDAYS.

Date.prototype.addDays = function(days) { var date = new Date(this.valueOf());     date.setDate(date.getDate() + days);     return date; }

https://jsfiddle.net/fn2bodku/

Post a Comment

Previous Post Next Post