I want to override javascript Date. Aim is to get time 1 hour prior to the current time. But if arguments are passed to the Date function, it should behave in a default way. Is there any way to achieve this ? (should work on IE11 as well)
I have tried something like this but it fails for certain arguments.
Date = function(options) {
Date.prototype = x.prototype;
if(options)
return new x(Array.prototype.slice.call(arguments).join())
else
return new x(x.now()-(1000*60*60))
}