Skip to content

Instantly share code, notes, and snippets.

@Zyst
Created September 29, 2016 15:03
Show Gist options
  • Save Zyst/2088fd3063f8f2ce2c7e959db75adf6f to your computer and use it in GitHub Desktop.
Save Zyst/2088fd3063f8f2ce2c7e959db75adf6f to your computer and use it in GitHub Desktop.
// Subtracts the number of days to a Date and returns it
Date.prototype.subtractDays = function(days) {
var dat = new Date(this.valueOf());
dat.setDate(dat.getDate() - days);
return dat;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment