ExtensionMethod.NET Home of 880 C#, Visual Basic, F# and Javascript extension methods

addDays

Adding and subtracting days from Date

Source

Date.prototype.addDays = function(amount) {
  return new Date(this.getFullYear(), this.getMonth(), this.getDate() + amount);
}

Example

var date = app.selectedDate.addDays(-1);

Author: Loek van den Ouweland

Submitted on: 27 feb. 2018

Language: JavaScript

Type: Date

Views: 4127