Skip to content

Instantly share code, notes, and snippets.

@diversario
Created October 20, 2012 22:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save diversario/3924989 to your computer and use it in GitHub Desktop.
Save diversario/3924989 to your computer and use it in GitHub Desktop.
Stub Javascript Date()
var oldDate = Date;
Date = function () {
var args = arguments.length > 0 ? Array.prototype.slice.call(arguments) : [1293861600];
if (typeof args[0] === 'string') {
args = ["'" + args[0] + "'"];
}
return new Function('return new oldDate(' + args.join(',') + ');')();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment