UNPKG

datetimes

Version:

Extend class of Date

20 lines (16 loc) 575 B
'use strict'; function Datetimes() { var x = new (Function.prototype.bind.apply(Date, [Date].concat(Array.prototype.slice.call(arguments)))) x.__proto__ = Datetimes.prototype; return x; } //Methods Datetimes.prototype.__proto__ = Date.prototype; Datetimes.prototype.format = formatDatetimes; Datetimes.prototype.now = function() { return new Datetimes(); } Datetimes.prototype.noTimeZone = function() { return new Datetimes(noTimeZoneDatetimes.apply(noTimeZoneDatetimes, arguments)); }; if (module) module.exports = Datetimes;