Skip to content

Instantly share code, notes, and snippets.

View leobetosouza's full-sized avatar

Leonardo Alberto Souza leobetosouza

View GitHub Profile
@leobetosouza
leobetosouza / Date.prototype.diff.js
Created April 27, 2012 02:56 — forked from netojoaobatista/Date.prototype.diff.js
Returns the difference between two Date objects.
Object.defineProperty(Date.prototype,"diff",{
writable: false, configurable: false, enumerable: true,
/**
* Returns the difference between two Date objects.
* @param {Date} The date to compare to.
* @return {Object}
* @throws {TypeError}
*/
value: function(date) {