typescript-dotnet-amd
Version:
A JavaScript-Friendly .NET Based TypeScript Library.
6 lines • 1.4 kB
JavaScript
/*!
* @author electricessence / https://github.com/electricessence/
* Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md
*/
define(["require","exports","../Compare","./TimeUnit","../Lazy"],function(t,e,o,i,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=function(){function t(t){void 0===t&&(t=0),this._quantity=t,this._resetTotal()}return t.prototype.getTotalMilliseconds=function(){return this._quantity},Object.defineProperty(t.prototype,"direction",{get:function(){return o.compare(this.getTotalMilliseconds(),0)},enumerable:!0,configurable:!0}),t.prototype.equals=function(t){return o.areEqual(this.getTotalMilliseconds(),t&&t.total&&t.total.milliseconds)},t.prototype.compareTo=function(t){return o.compare(this.getTotalMilliseconds(),t&&t.total&&t.total.milliseconds)},t.prototype._resetTotal=function(){var t=this,e=this._total;e&&!e.isValueCreated||(this._total=n.Lazy.create(function(){var e=t.getTotalMilliseconds();return Object.freeze({ticks:1e4*e,milliseconds:e,seconds:e/1e3,minutes:e/6e4,hours:e/36e5,days:e/864e5})}))},Object.defineProperty(t.prototype,"total",{get:function(){return this._total.value},enumerable:!0,configurable:!0}),t.prototype.getTotal=function(t){return i.TimeUnit.fromMilliseconds(this.getTotalMilliseconds(),t)},t}();e.TimeQuantity=r,e["default"]=r});
//# sourceMappingURL=TimeQuantity.js.map