-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtardis.js
More file actions
25 lines (25 loc) · 836 Bytes
/
tardis.js
File metadata and controls
25 lines (25 loc) · 836 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
;(function () {
var Tardis, RealDate, FakeDate;
RealDate = window.Date;
Tardis = new function () {};
Tardis.currentTime = new RealDate();
Tardis.setTime = function (newTime) {
this.currentTime = newTime;
};
FakeDate = function (arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8) {
var spoof;
if (arg1 != undefined) {
spoof = new RealDate(arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8);
} else {
spoof = new RealDate(Tardis.currentTime)
}
spoof.setTime(spoof.getTime() + 3600000);
if (this.constructor !== FakeDate) {
spoof = spoof.toString();
}
return spoof;
};
FakeDate.prototype = Object.create(Date.prototype);
FakeDate.prototype.constructor = FakeDate;
window.Date = FakeDate;
})();