Skip to content

Instantly share code, notes, and snippets.

@mattsacks
Created December 26, 2012 18:58
Show Gist options
  • Save mattsacks/4382229 to your computer and use it in GitHub Desktop.
Save mattsacks/4382229 to your computer and use it in GitHub Desktop.
Changing the default date from the Date constructor
var defaultDate = '1/10/2013';
window['d8'] = Date;
Date = function(time) {
return time == null ? new d8(defaultDate) : new d8(time);
}
for (var key in Date.prototype) Date[key] = d8[key];
// fix mootools and d3
Date.parse = d8.parse;
Date.now = d8.now;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment