Created
December 26, 2012 18:58
-
-
Save mattsacks/4382229 to your computer and use it in GitHub Desktop.
Changing the default date from the Date constructor
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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