Blog
JavaScript – Date.prototype Extensions
Yesterday’s post made me want to extend the Date.prototype object a bit more. Therefore I came up with the following code: The above code defines the following prototypal functions: Date Adders Date.prototype.addYears() Date.prototype.addMonths() Date.prototype.addDays() Date.prototype.addHours() Date.prototype.addMinutes() Date.prototype.addSeconds() Date.prototype.addMilliseconds() Date Differs Date.prototype.diffYears() Date.prototype.diffMonths() Date.prototype.diffDays() Date.prototype.diffHours() Date.prototype.diffMinutes() Date.prototype.diffSeconds() Date.prototype.diffMilliseconds() Unlike the XDate Read more…