Skip to content

Instantly share code, notes, and snippets.

View Steingo's full-sized avatar

Stein Goering Steingo

  • ACEware Systems
View GitHub Profile
@wildhart
wildhart / dateProtypes.js
Last active March 21, 2023 02:11
Date prototype functions
Date.prototype.addMins = function(mins) {
var dat = new Date(this.valueOf()); // make a new date coz we can't change the original
dat.setMinutes(dat.getMinutes() + mins*1); // force mins to be integer instead of string
return dat;
};
Date.prototype.addDays = function(days) {
var dat = new Date(this.valueOf()); // make a new date coz we can't change the original
dat.setDate(dat.getDate() + days*1); // force days to be integer instead of string
return dat;