Comparing version 0.2.0 to 0.2.1
233
index.js
@@ -1,19 +0,18 @@ | ||
'use strict'; | ||
"use strict"; | ||
var d = require('d') | ||
, pad = require('es5-ext/number/#/pad') | ||
, date = require('es5-ext/date/valid-date') | ||
, daysInMonth = require('es5-ext/date/#/days-in-month') | ||
, copy = require('es5-ext/date/#/copy') | ||
, dfloor = require('es5-ext/date/#/floor-day') | ||
, mfloor = require('es5-ext/date/#/floor-month') | ||
, yfloor = require('es5-ext/date/#/floor-year') | ||
, toInteger = require('es5-ext/number/to-integer') | ||
, toPosInt = require('es5-ext/number/to-pos-integer') | ||
var d = require("d") | ||
, pad = require("es5-ext/number/#/pad") | ||
, date = require("es5-ext/date/valid-date") | ||
, daysInMonth = require("es5-ext/date/#/days-in-month") | ||
, copy = require("es5-ext/date/#/copy") | ||
, dfloor = require("es5-ext/date/#/floor-day") | ||
, mfloor = require("es5-ext/date/#/floor-month") | ||
, yfloor = require("es5-ext/date/#/floor-year") | ||
, toInteger = require("es5-ext/number/to-integer") | ||
, toPosInt = require("es5-ext/number/to-pos-integer") | ||
, isValue = require("es5-ext/object/is-value"); | ||
, abs = Math.abs | ||
var abs = Math.abs, format, toPrimitive, getYear, Duration, getCalcData; | ||
, format, valueOf, getYear, Duration, getCalcData; | ||
format = require('es5-ext/string/format-method')({ | ||
format = require("es5-ext/string/format-method")({ | ||
y: function () { return String(abs(this.year)); }, | ||
@@ -34,9 +33,9 @@ m: function () { return pad.call(abs(this.month), 2); }, | ||
sign: function () { return (this.to < this.from) ? '-' : ''; } | ||
sign: function () { return this.to < this.from ? "-" : ""; } | ||
}); | ||
getCalcData = function (duration) { | ||
return (duration.to < duration.from) ? | ||
{ to: duration.from, from: duration.to, sign: -1 } : | ||
{ to: duration.to, from: duration.from, sign: 1 }; | ||
return duration.to < duration.from | ||
? { to: duration.from, from: duration.to, sign: -1 } | ||
: { to: duration.to, from: duration.from, sign: 1 }; | ||
}; | ||
@@ -49,7 +48,7 @@ | ||
this.from = date(from); | ||
this.to = (to == null) ? new Date() : date(to); | ||
this.to = isValue(to) ? date(to) : new Date(); | ||
}; | ||
Duration.prototype = Object.create(Object.prototype, { | ||
valueOf: d(valueOf = function () { return this.to - this.from; }), | ||
valueOf: d(toPrimitive = function () { return this.to - this.from; }), | ||
millisecond: d.gs(function () { return this.milliseconds % 1000; }), | ||
@@ -60,122 +59,110 @@ second: d.gs(function () { return this.seconds % 60; }), | ||
day: d.gs(function () { | ||
var data = getCalcData(this) | ||
, x = copy.call(data.to); | ||
var data = getCalcData(this), x = copy.call(data.to); | ||
x.setMonth(x.getMonth() - 1); | ||
x = daysInMonth.call(x); | ||
return data.sign * ((x - data.from.getDate() + data.to.getDate()) % x - | ||
((data.from - dfloor.call(copy.call(data.from))) > | ||
(data.to - dfloor.call(copy.call(data.to))))); | ||
return ( | ||
data.sign * | ||
(((x - data.from.getDate() + data.to.getDate()) % x) - | ||
(data.from - dfloor.call(copy.call(data.from)) > | ||
data.to - dfloor.call(copy.call(data.to)))) | ||
); | ||
}), | ||
month: d.gs(function () { | ||
var data = getCalcData(this); | ||
return data.sign * ((12 - data.from.getMonth() + data.to.getMonth()) % 12 - | ||
((data.from - mfloor.call(copy.call(data.from))) > | ||
(data.to - mfloor.call(copy.call(data.to))))); | ||
return ( | ||
data.sign * | ||
(((12 - data.from.getMonth() + data.to.getMonth()) % 12) - | ||
(data.from - mfloor.call(copy.call(data.from)) > | ||
data.to - mfloor.call(copy.call(data.to)))) | ||
); | ||
}), | ||
year: d.gs(getYear = function () { | ||
year: d.gs( | ||
getYear = function () { | ||
var data = getCalcData(this); | ||
return ( | ||
data.sign * | ||
(data.to.getFullYear() - | ||
data.from.getFullYear() - | ||
(data.from - yfloor.call(copy.call(data.from)) > | ||
data.to - yfloor.call(copy.call(data.to)))) | ||
); | ||
} | ||
), | ||
milliseconds: d.gs(toPrimitive, null), | ||
seconds: d.gs(function () { return toInteger(this.valueOf() / 1000); }), | ||
minutes: d.gs(function () { return toInteger(this.valueOf() / (1000 * 60)); }), | ||
hours: d.gs(function () { return toInteger(this.valueOf() / (1000 * 60 * 60)); }), | ||
days: d.gs(function () { return toInteger(this.valueOf() / (1000 * 60 * 60 * 24)); }), | ||
months: d.gs(function () { | ||
var data = getCalcData(this); | ||
return data.sign * (data.to.getFullYear() - data.from.getFullYear() - | ||
((data.from - yfloor.call(copy.call(data.from))) > | ||
(data.to - yfloor.call(copy.call(data.to))))); | ||
return ( | ||
data.sign * | ||
((data.to.getFullYear() - data.from.getFullYear()) * 12 + | ||
data.to.getMonth() - | ||
data.from.getMonth() - | ||
(data.from - mfloor.call(copy.call(data.from)) > | ||
data.to - mfloor.call(copy.call(data.to)))) | ||
); | ||
}), | ||
years: d.gs(getYear), | ||
milliseconds: d.gs(valueOf, null), | ||
seconds: d.gs(function () { return toInteger(this.valueOf() / 1000); }), | ||
minutes: d.gs(function () { | ||
return toInteger(this.valueOf() / (1000 * 60)); | ||
_resolveSign: d(function (isNonZero) { | ||
if (!isNonZero) return ""; | ||
return this.to < this.from ? "-" : ""; | ||
}), | ||
hours: d.gs(function () { | ||
return toInteger(this.valueOf() / (1000 * 60 * 60)); | ||
_toStringDefaultDate: d(function (threshold, s, isNonZero) { | ||
if (!this.days && threshold < 0) return this._resolveSign(isNonZero) + s; | ||
if (threshold-- <= 0) s = abs(isNonZero = this.day) + "d" + (s ? " " : "") + s; | ||
if (!this.months && threshold < 0) return this._resolveSign(isNonZero) + s; | ||
if (threshold-- <= 0) s = abs(isNonZero = this.month) + "m" + (s ? " " : "") + s; | ||
if (this.years || threshold >= 0) s = abs(isNonZero = this.year) + "y" + (s ? " " : "") + s; | ||
return this._resolveSign(isNonZero) + s; | ||
}), | ||
days: d.gs(function () { | ||
return toInteger(this.valueOf() / (1000 * 60 * 60 * 24)); | ||
_toStringDefault: d(function (threshold) { | ||
var s = "", isNonZero; | ||
if (threshold-- <= 0) s += "." + pad.call(abs(isNonZero = this.millisecond), 3); | ||
if (!this.seconds && threshold < 0) return this._resolveSign(isNonZero) + s; | ||
if (threshold-- <= 0) { | ||
isNonZero = this.second; | ||
s = (this.minutes ? pad.call(abs(isNonZero), 2) : abs(isNonZero)) + s; | ||
} | ||
if (!this.minutes && threshold < 0) return this._resolveSign(isNonZero) + s; | ||
if (threshold-- <= 0) { | ||
isNonZero = this.minute; | ||
s = | ||
(this.hours || s ? pad.call(abs(isNonZero), 2) : abs(isNonZero)) + | ||
(s ? ":" : "") + | ||
s; | ||
} | ||
if (!this.hours && threshold < 0) return this._resolveSign(isNonZero) + s; | ||
if (threshold-- <= 0) s = pad.call(abs(isNonZero = this.hour), 2) + (s ? ":" : "") + s; | ||
return this._toStringDefaultDate(threshold, s, isNonZero); | ||
}), | ||
months: d.gs(function () { | ||
var data = getCalcData(this); | ||
return data.sign * ((data.to.getFullYear() - data.from.getFullYear()) * 12 + | ||
data.to.getMonth() - data.from.getMonth() - | ||
((data.from - mfloor.call(copy.call(data.from))) > | ||
(data.to - mfloor.call(copy.call(data.to))))); | ||
_toString1: d(function (threshold) { | ||
var tokens = [], isNonZero; | ||
if (threshold-- <= 0) tokens.unshift(abs(isNonZero = this.millisecond) + "ms"); | ||
if (!this.seconds && threshold < 0) return this._resolveSign(isNonZero) + tokens.join(" "); | ||
if (threshold-- <= 0) tokens.unshift(abs(isNonZero = this.second) + "s"); | ||
if (!this.minutes && threshold < 0) return this._resolveSign(isNonZero) + tokens.join(" "); | ||
if (threshold-- <= 0) tokens.unshift(abs(isNonZero = this.minute) + "m"); | ||
if (!this.hours && threshold < 0) return this._resolveSign(isNonZero) + tokens.join(" "); | ||
if (threshold-- <= 0) tokens.unshift(abs(isNonZero = this.hour) + "h"); | ||
if (!this.days && threshold < 0) return this._resolveSign(isNonZero) + tokens.join(" "); | ||
if (threshold-- <= 0) tokens.unshift(abs(isNonZero = this.day) + "d"); | ||
if (!this.months && threshold < 0) return this._resolveSign(isNonZero) + tokens.join(" "); | ||
if (threshold-- <= 0) tokens.unshift(abs(isNonZero = this.month) + "m"); | ||
if (!this.years && threshold < 0) return this._resolveSign(isNonZero) + tokens.join(" "); | ||
tokens.unshift(abs(isNonZero = this.year) + "y"); | ||
return this._resolveSign(isNonZero) + tokens.join(" "); | ||
}), | ||
years: d.gs(getYear), | ||
toString: d(function (pattern/*, threshold*/) { | ||
var s, threshold, last; | ||
if (pattern == null) pattern = 0; | ||
var threshold; | ||
if (!isValue(pattern)) pattern = 0; | ||
if (isNaN(pattern)) return format.call(this, pattern); | ||
pattern = Number(pattern); | ||
threshold = toPosInt(arguments[1]); | ||
s = ""; | ||
if (pattern === 1) { | ||
if (threshold-- <= 0) s += abs(last = this.millisecond) + "ms"; | ||
if (this.seconds || (threshold >= 0)) { | ||
if (threshold-- <= 0) { | ||
s = abs(last = this.second) + "s" + (s ? " " : "") + s; | ||
} | ||
if (this.minutes || (threshold >= 0)) { | ||
if (threshold-- <= 0) { | ||
s = abs(last = this.minute) + "m" + (s ? " " : "") + s; | ||
} | ||
if (this.hours || (threshold >= 0)) { | ||
if (threshold-- <= 0) { | ||
s = abs(last = this.hour) + "h" + (s ? " " : "") + s; | ||
} | ||
if (this.days || (threshold >= 0)) { | ||
if (threshold-- <= 0) { | ||
s = abs(last = this.day) + "d" + (s ? " " : "") + s; | ||
} | ||
if (this.months || (threshold >= 0)) { | ||
if (threshold-- <= 0) { | ||
s = abs(last = this.month) + "m" + (s ? " " : "") + s; | ||
} | ||
if (this.years || (threshold >= 0)) { | ||
s = abs(last = this.year) + "y" + | ||
(s ? " " : "") + s; | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} else { | ||
if (threshold-- <= 0) { | ||
s += "." + pad.call(abs(last = this.millisecond), 3); | ||
} | ||
if (this.seconds || (threshold >= 0)) { | ||
if (threshold-- <= 0) { | ||
last = this.second; | ||
s = (this.minutes ? pad.call(abs(last), 2) : | ||
abs(last)) + s; | ||
} | ||
if (this.minutes || (threshold >= 0)) { | ||
if (threshold-- <= 0) { | ||
last = this.minute; | ||
s = ((this.hours || s) ? pad.call(abs(last), 2) : abs(last)) + | ||
(s ? ":" : "") + s; | ||
} | ||
if (this.hours || (threshold >= 0)) { | ||
if (threshold-- <= 0) { | ||
s = pad.call(abs(last = this.hour), 2) + (s ? ":" : "") + s; | ||
} | ||
if (this.days || (threshold >= 0)) { | ||
if (threshold-- <= 0) { | ||
s = abs(last = this.day) + "d" + (s ? " " : "") + s; | ||
} | ||
if (this.months || (threshold >= 0)) { | ||
if (threshold-- <= 0) { | ||
s = abs(last = this.month) + "m" + (s ? " " : "") + s; | ||
} | ||
if (this.years || (threshold >= 0)) { | ||
s = abs(last = this.year) + "y" + | ||
(s ? " " : "") + s; | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
if (last && (this.to < this.from)) (s = '-' + s); | ||
return s; | ||
if (pattern === 1) return this._toString1(threshold); | ||
return this._toStringDefault(threshold); | ||
}) | ||
}); |
{ | ||
"name": "duration", | ||
"version": "0.2.0", | ||
"version": "0.2.1", | ||
"description": "Time duration utilities", | ||
@@ -16,11 +16,32 @@ "author": "Mariusz Nowak <medyk@medikoo.com> (http://www.medikoo.com/)", | ||
"dependencies": { | ||
"d": "~0.1.1", | ||
"es5-ext": "~0.10.2" | ||
"d": "1", | ||
"es5-ext": "~0.10.23" | ||
}, | ||
"devDependencies": { | ||
"tad": "~0.1.21" | ||
"eslint": "^5.4", | ||
"eslint-config-medikoo-es5": "^1.6.1", | ||
"tad": "~0.2.7" | ||
}, | ||
"eslintConfig": { | ||
"extends": "medikoo-es5", | ||
"root": true, | ||
"rules": { | ||
"consistent-return": "off", | ||
"id-length": "off" | ||
}, | ||
"overrides": [ | ||
{ | ||
"files": "test/**", | ||
"rules": { | ||
"max-lines": "off", | ||
"max-statements": "off" | ||
} | ||
} | ||
] | ||
}, | ||
"scripts": { | ||
"lint": "eslint --ignore-path=.gitignore .", | ||
"test": "node ./node_modules/tad/bin/tad" | ||
} | ||
}, | ||
"license": "ISC" | ||
} |
@@ -0,1 +1,6 @@ | ||
[![*nix build status][nix-build-image]][nix-build-url] | ||
[![Windows build status][win-build-image]][win-build-url] | ||
![Transpilation status][transpilation-image] | ||
[![npm version][npm-image]][npm-url] | ||
# duration - Time duration utilities | ||
@@ -9,3 +14,3 @@ | ||
$ npm install duration | ||
$ npm install duration | ||
@@ -19,6 +24,5 @@ ### Browser | ||
```javascript | ||
var Duration = require('duration') | ||
var Duration = require("duration"); | ||
var duration = new Duration(new Date(2000, 6, 7), | ||
new Date(2010, 8, 13, 3, 23, 8, 456)); | ||
var duration = new Duration(new Date(2000, 6, 7), new Date(2010, 8, 13, 3, 23, 8, 456)); | ||
@@ -42,4 +46,3 @@ console.log("Years: ", duration.years); | ||
console.log("Alternative string representation: ", duration.toString(1)); | ||
console.log("Custom string representation: ", | ||
duration.toString("H: %Hs m: %M")); | ||
console.log("Custom string representation: ", duration.toString("H: %Hs m: %M")); | ||
``` | ||
@@ -140,7 +143,7 @@ | ||
10y 2m 6d 03:23:08.456 | ||
10y 2m 6d 03:23:08.456 | ||
When invoked with mode `1`, returns alternative representation: | ||
10y 2m 6d 3h 23m 8s 456ms | ||
10y 2m 6d 3h 23m 8s 456ms | ||
@@ -150,7 +153,7 @@ Representation returned by default modes can be customized with threshold setting that trims lowest units: | ||
```javascript | ||
duration.toString(); // 10y 2m 6d 03:23:08.456 | ||
duration.toString(); // 10y 2m 6d 03:23:08.456 | ||
duration.toString(0, 1); // 10y 2m 6d 03:23:08 | ||
duration.toString(0, 2); // 10y 2m 6d 03:23 | ||
duration.toString(1); // 10y 2m 6d 3h 23m 8s 456ms | ||
duration.toString(1); // 10y 2m 6d 3h 23m 8s 456ms | ||
duration.toString(1, 1); // 10y 2m 6d 3h 23m 8s | ||
@@ -164,19 +167,27 @@ duration.toString(1, 2); // 10y 2m 6d 3h 23m | ||
* `%y` - `duration.year` | ||
* `%m` - `duration.month` | ||
* `%d` - `duration.day` | ||
* `%H` - `duration.hour` | ||
* `%M` - `duration.minute` | ||
* `%S` - `duration.second` | ||
* `%L` - `duration.millisecond` | ||
* `%ms` - `duration.months` | ||
* `%ds` - `duration.days` | ||
* `%Hs` - `duration.hours` | ||
* `%Ms` - `duration.minutes` | ||
* `%Ss` - `duration.seconds` | ||
* `%Ls` - `duration.milliseconds` | ||
* `%sign` - If duration is negative outputs `-` otherwise empty string | ||
- `%y` - `duration.year` | ||
- `%m` - `duration.month` | ||
- `%d` - `duration.day` | ||
- `%H` - `duration.hour` | ||
- `%M` - `duration.minute` | ||
- `%S` - `duration.second` | ||
- `%L` - `duration.millisecond` | ||
- `%ms` - `duration.months` | ||
- `%ds` - `duration.days` | ||
- `%Hs` - `duration.hours` | ||
- `%Ms` - `duration.minutes` | ||
- `%Ss` - `duration.seconds` | ||
- `%Ls` - `duration.milliseconds` | ||
- `%sign` - If duration is negative outputs `-` otherwise empty string | ||
## Tests [![Build Status](https://secure.travis-ci.org/medikoo/duration.png?branch=master)](https://secure.travis-ci.org/medikoo/es5-ext) | ||
## Tests | ||
$ npm test | ||
$ npm test | ||
[nix-build-image]: https://semaphoreci.com/api/v1/medikoo-org/duration/branches/master/shields_badge.svg | ||
[nix-build-url]: https://semaphoreci.com/medikoo-org/duration | ||
[win-build-image]: https://ci.appveyor.com/api/projects/status/nt9c72n1ay9coree?svg=true | ||
[win-build-url]: https://ci.appveyor.com/project/medikoo/duration | ||
[transpilation-image]: https://img.shields.io/badge/transpilation-free-brightgreen.svg | ||
[npm-image]: https://img.shields.io/npm/v/duration.svg | ||
[npm-url]: https://www.npmjs.com/package/duration |
@@ -1,4 +0,4 @@ | ||
'use strict'; | ||
"use strict"; | ||
var copy = require('es5-ext/date/#/copy'); | ||
var copy = require("es5-ext/date/#/copy"); | ||
@@ -40,22 +40,22 @@ module.exports = function (t) { | ||
a(d.toString(), '.011', "String presentation"); | ||
a(d.toString(0, 0), '.011', "String presentation: Threshold #0"); | ||
a(d.toString(0, 1), '0', "String presentation: Threshold #1"); | ||
a(d.toString(0, 2), '0', "String presentation: Threshold #2"); | ||
a(d.toString(0, 3), '00', "String presentation: Threshold #3"); | ||
a(d.toString(0, 4), '0d', "String presentation: Threshold #4"); | ||
a(d.toString(0, 5), '0m', "String presentation: Threshold #5"); | ||
a(d.toString(0, 6), '0y', "String presentation: Threshold #6"); | ||
a(d.toString(0, 7), '0y', "String presentation: Threshold #7"); | ||
a(d.toString(1), '11ms', "String presentation #2"); | ||
a(d.toString(1, 0), '11ms', "String presentation #2: Threshold #0"); | ||
a(d.toString(1, 1), '0s', "String presentation #2: Threshold #1"); | ||
a(d.toString(1, 2), '0m', "String presentation #2: Threshold #2"); | ||
a(d.toString(1, 3), '0h', "String presentation #2: Threshold #3"); | ||
a(d.toString(1, 4), '0d', "String presentation #2: Threshold #4"); | ||
a(d.toString(1, 5), '0m', "String presentation #2: Threshold #5"); | ||
a(d.toString(1, 6), '0y', "String presentation #2: Threshold #6"); | ||
a(d.toString(1, 7), '0y', "String presentation #2: Threshold #7"); | ||
a(d.toString(' %sign.%L.%Ls.%S.%Ss.%M.%Ms.%H.%Hs.%d.%ds.%m.%ms.%y '), | ||
' .011.11.00.0.00.0.00.0.00.0.00.0.0 ', "String presentation (custom)"); | ||
a(d.toString(), ".011", "String presentation"); | ||
a(d.toString(0, 0), ".011", "String presentation: Threshold #0"); | ||
a(d.toString(0, 1), "0", "String presentation: Threshold #1"); | ||
a(d.toString(0, 2), "0", "String presentation: Threshold #2"); | ||
a(d.toString(0, 3), "00", "String presentation: Threshold #3"); | ||
a(d.toString(0, 4), "0d", "String presentation: Threshold #4"); | ||
a(d.toString(0, 5), "0m", "String presentation: Threshold #5"); | ||
a(d.toString(0, 6), "0y", "String presentation: Threshold #6"); | ||
a(d.toString(0, 7), "0y", "String presentation: Threshold #7"); | ||
a(d.toString(1), "11ms", "String presentation #2"); | ||
a(d.toString(1, 0), "11ms", "String presentation #2: Threshold #0"); | ||
a(d.toString(1, 1), "0s", "String presentation #2: Threshold #1"); | ||
a(d.toString(1, 2), "0m", "String presentation #2: Threshold #2"); | ||
a(d.toString(1, 3), "0h", "String presentation #2: Threshold #3"); | ||
a(d.toString(1, 4), "0d", "String presentation #2: Threshold #4"); | ||
a(d.toString(1, 5), "0m", "String presentation #2: Threshold #5"); | ||
a(d.toString(1, 6), "0y", "String presentation #2: Threshold #6"); | ||
a(d.toString(1, 7), "0y", "String presentation #2: Threshold #7"); | ||
a(d.toString(" %sign.%L.%Ls.%S.%Ss.%M.%Ms.%H.%Hs.%d.%ds.%m.%ms.%y "), | ||
" .011.11.00.0.00.0.00.0.00.0.00.0.0 ", "String presentation (custom)"); | ||
@@ -80,31 +80,31 @@ d = t(d2, d1); | ||
a(d.toString(), '-.011', "String presentation: Negative"); | ||
a(d.toString(0, 0), '-.011', | ||
a(d.toString(), "-.011", "String presentation: Negative"); | ||
a(d.toString(0, 0), "-.011", | ||
"String presentation: Negative: Threshold #0"); | ||
a(d.toString(0, 1), '0', "String presentation: Negative: Threshold #1"); | ||
a(d.toString(0, 2), '0', "String presentation: Negative: Threshold #2"); | ||
a(d.toString(0, 3), '00', "String presentation: Negative: Threshold #3"); | ||
a(d.toString(0, 4), '0d', "String presentation: Negative: Threshold #4"); | ||
a(d.toString(0, 5), '0m', "String presentation: Negative: Threshold #5"); | ||
a(d.toString(0, 6), '0y', "String presentation: Negative: Threshold #6"); | ||
a(d.toString(0, 7), '0y', "String presentation: Negative: Threshold #7"); | ||
a(d.toString(1), '-11ms', "String presentation #2: Negative"); | ||
a(d.toString(1, 0), '-11ms', | ||
a(d.toString(0, 1), "0", "String presentation: Negative: Threshold #1"); | ||
a(d.toString(0, 2), "0", "String presentation: Negative: Threshold #2"); | ||
a(d.toString(0, 3), "00", "String presentation: Negative: Threshold #3"); | ||
a(d.toString(0, 4), "0d", "String presentation: Negative: Threshold #4"); | ||
a(d.toString(0, 5), "0m", "String presentation: Negative: Threshold #5"); | ||
a(d.toString(0, 6), "0y", "String presentation: Negative: Threshold #6"); | ||
a(d.toString(0, 7), "0y", "String presentation: Negative: Threshold #7"); | ||
a(d.toString(1), "-11ms", "String presentation #2: Negative"); | ||
a(d.toString(1, 0), "-11ms", | ||
"String presentation #2: Negative: Threshold #0"); | ||
a(d.toString(1, 1), '0s', | ||
a(d.toString(1, 1), "0s", | ||
"String presentation #2: Negative: Threshold #1"); | ||
a(d.toString(1, 2), '0m', | ||
a(d.toString(1, 2), "0m", | ||
"String presentation #2: Negative: Threshold #2"); | ||
a(d.toString(1, 3), '0h', | ||
a(d.toString(1, 3), "0h", | ||
"String presentation #2: Negative: Threshold #3"); | ||
a(d.toString(1, 4), '0d', | ||
a(d.toString(1, 4), "0d", | ||
"String presentation #2: Negative: Threshold #4"); | ||
a(d.toString(1, 5), '0m', | ||
a(d.toString(1, 5), "0m", | ||
"String presentation #2: Negative: Threshold #5"); | ||
a(d.toString(1, 6), '0y', | ||
a(d.toString(1, 6), "0y", | ||
"String presentation #2: Negative: Threshold #6"); | ||
a(d.toString(1, 7), '0y', | ||
a(d.toString(1, 7), "0y", | ||
"String presentation #2: Negative: Threshold #7"); | ||
a(d.toString(' %sign.%L.%Ls.%S.%Ss.%M.%Ms.%H.%Hs.%d.%ds.%m.%ms.%y '), | ||
' -.011.11.00.0.00.0.00.0.00.0.00.0.0 ', | ||
a(d.toString(" %sign.%L.%Ls.%S.%Ss.%M.%Ms.%H.%Hs.%d.%ds.%m.%ms.%y "), | ||
" -.011.11.00.0.00.0.00.0.00.0.00.0.0 ", | ||
"String presentation (custom): Negative"); | ||
@@ -136,22 +136,22 @@ }, | ||
a(d.toString(), '7.123', "String presentation"); | ||
a(d.toString(0, 0), '7.123', "String presentation: Threshold #0"); | ||
a(d.toString(0, 1), '7', "String presentation: Threshold #1"); | ||
a(d.toString(0, 2), '0', "String presentation: Threshold #2"); | ||
a(d.toString(0, 3), '00', "String presentation: Threshold #3"); | ||
a(d.toString(0, 4), '0d', "String presentation: Threshold #4"); | ||
a(d.toString(0, 5), '0m', "String presentation: Threshold #5"); | ||
a(d.toString(0, 6), '0y', "String presentation: Threshold #6"); | ||
a(d.toString(0, 7), '0y', "String presentation: Threshold #7"); | ||
a(d.toString(1), '7s 123ms', "String presentation #2"); | ||
a(d.toString(1, 0), '7s 123ms', "String presentation #2: Threshold #0"); | ||
a(d.toString(1, 1), '7s', "String presentation #2: Threshold #1"); | ||
a(d.toString(1, 2), '0m', "String presentation #2: Threshold #2"); | ||
a(d.toString(1, 3), '0h', "String presentation #2: Threshold #3"); | ||
a(d.toString(1, 4), '0d', "String presentation #2: Threshold #4"); | ||
a(d.toString(1, 5), '0m', "String presentation #2: Threshold #5"); | ||
a(d.toString(1, 6), '0y', "String presentation #2: Threshold #6"); | ||
a(d.toString(1, 7), '0y', "String presentation #2: Threshold #7"); | ||
a(d.toString(' %sign.%L.%Ls.%S.%Ss.%M.%Ms.%H.%Hs.%d.%ds.%m.%ms.%y '), | ||
' .123.' + (7 * 1000 + 123) + '.07.7.00.0.00.0.00.0.00.0.0 ', | ||
a(d.toString(), "7.123", "String presentation"); | ||
a(d.toString(0, 0), "7.123", "String presentation: Threshold #0"); | ||
a(d.toString(0, 1), "7", "String presentation: Threshold #1"); | ||
a(d.toString(0, 2), "0", "String presentation: Threshold #2"); | ||
a(d.toString(0, 3), "00", "String presentation: Threshold #3"); | ||
a(d.toString(0, 4), "0d", "String presentation: Threshold #4"); | ||
a(d.toString(0, 5), "0m", "String presentation: Threshold #5"); | ||
a(d.toString(0, 6), "0y", "String presentation: Threshold #6"); | ||
a(d.toString(0, 7), "0y", "String presentation: Threshold #7"); | ||
a(d.toString(1), "7s 123ms", "String presentation #2"); | ||
a(d.toString(1, 0), "7s 123ms", "String presentation #2: Threshold #0"); | ||
a(d.toString(1, 1), "7s", "String presentation #2: Threshold #1"); | ||
a(d.toString(1, 2), "0m", "String presentation #2: Threshold #2"); | ||
a(d.toString(1, 3), "0h", "String presentation #2: Threshold #3"); | ||
a(d.toString(1, 4), "0d", "String presentation #2: Threshold #4"); | ||
a(d.toString(1, 5), "0m", "String presentation #2: Threshold #5"); | ||
a(d.toString(1, 6), "0y", "String presentation #2: Threshold #6"); | ||
a(d.toString(1, 7), "0y", "String presentation #2: Threshold #7"); | ||
a(d.toString(" %sign.%L.%Ls.%S.%Ss.%M.%Ms.%H.%Hs.%d.%ds.%m.%ms.%y "), | ||
" .123." + (7 * 1000 + 123) + ".07.7.00.0.00.0.00.0.00.0.0 ", | ||
"String presentation (custom)"); | ||
@@ -177,31 +177,31 @@ | ||
a(d.toString(), '-7.123', "String presentation: Negative"); | ||
a(d.toString(0, 0), '-7.123', | ||
a(d.toString(), "-7.123", "String presentation: Negative"); | ||
a(d.toString(0, 0), "-7.123", | ||
"String presentation: Negative: Threshold #0"); | ||
a(d.toString(0, 1), '-7', "String presentation: Negative: Threshold #1"); | ||
a(d.toString(0, 2), '0', "String presentation: Negative: Threshold #2"); | ||
a(d.toString(0, 3), '00', "String presentation: Negative: Threshold #3"); | ||
a(d.toString(0, 4), '0d', "String presentation: Negative: Threshold #4"); | ||
a(d.toString(0, 5), '0m', "String presentation: Negative: Threshold #5"); | ||
a(d.toString(0, 6), '0y', "String presentation: Negative: Threshold #6"); | ||
a(d.toString(0, 7), '0y', "String presentation: Negative: Threshold #7"); | ||
a(d.toString(1), '-7s 123ms', "String presentation #2: Negative"); | ||
a(d.toString(1, 0), '-7s 123ms', | ||
a(d.toString(0, 1), "-7", "String presentation: Negative: Threshold #1"); | ||
a(d.toString(0, 2), "0", "String presentation: Negative: Threshold #2"); | ||
a(d.toString(0, 3), "00", "String presentation: Negative: Threshold #3"); | ||
a(d.toString(0, 4), "0d", "String presentation: Negative: Threshold #4"); | ||
a(d.toString(0, 5), "0m", "String presentation: Negative: Threshold #5"); | ||
a(d.toString(0, 6), "0y", "String presentation: Negative: Threshold #6"); | ||
a(d.toString(0, 7), "0y", "String presentation: Negative: Threshold #7"); | ||
a(d.toString(1), "-7s 123ms", "String presentation #2: Negative"); | ||
a(d.toString(1, 0), "-7s 123ms", | ||
"String presentation #2: Negative: Threshold #0"); | ||
a(d.toString(1, 1), '-7s', | ||
a(d.toString(1, 1), "-7s", | ||
"String presentation #2: Negative: Threshold #1"); | ||
a(d.toString(1, 2), '0m', | ||
a(d.toString(1, 2), "0m", | ||
"String presentation #2: Negative: Threshold #2"); | ||
a(d.toString(1, 3), '0h', | ||
a(d.toString(1, 3), "0h", | ||
"String presentation #2: Negative: Threshold #3"); | ||
a(d.toString(1, 4), '0d', | ||
a(d.toString(1, 4), "0d", | ||
"String presentation #2: Negative: Threshold #4"); | ||
a(d.toString(1, 5), '0m', | ||
a(d.toString(1, 5), "0m", | ||
"String presentation #2: Negative: Threshold #5"); | ||
a(d.toString(1, 6), '0y', | ||
a(d.toString(1, 6), "0y", | ||
"String presentation #2: Negative: Threshold #6"); | ||
a(d.toString(1, 7), '0y', | ||
a(d.toString(1, 7), "0y", | ||
"String presentation #2: Negative: Threshold #7"); | ||
a(d.toString(' %sign.%L.%Ls.%S.%Ss.%M.%Ms.%H.%Hs.%d.%ds.%m.%ms.%y '), | ||
' -.123.' + (7 * 1000 + 123) + '.07.7.00.0.00.0.00.0.00.0.0 ', | ||
a(d.toString(" %sign.%L.%Ls.%S.%Ss.%M.%Ms.%H.%Hs.%d.%ds.%m.%ms.%y "), | ||
" -.123." + (7 * 1000 + 123) + ".07.7.00.0.00.0.00.0.00.0.0 ", | ||
"String presentation (custom): Negative"); | ||
@@ -234,24 +234,24 @@ }, | ||
a(d.toString(), '07:12.123', "String presentation"); | ||
a(d.toString(0, 0), '07:12.123', "String presentation: Threshold #0"); | ||
a(d.toString(0, 1), '07:12', "String presentation: Threshold #1"); | ||
a(d.toString(0, 2), '7', "String presentation: Threshold #2"); | ||
a(d.toString(0, 3), '00', "String presentation: Threshold #3"); | ||
a(d.toString(0, 4), '0d', "String presentation: Threshold #4"); | ||
a(d.toString(0, 5), '0m', "String presentation: Threshold #5"); | ||
a(d.toString(0, 6), '0y', "String presentation: Threshold #6"); | ||
a(d.toString(0, 7), '0y', "String presentation: Threshold #7"); | ||
a(d.toString(1), '7m 12s 123ms', "String presentation #2"); | ||
a(d.toString(1, 0), '7m 12s 123ms', | ||
a(d.toString(), "07:12.123", "String presentation"); | ||
a(d.toString(0, 0), "07:12.123", "String presentation: Threshold #0"); | ||
a(d.toString(0, 1), "07:12", "String presentation: Threshold #1"); | ||
a(d.toString(0, 2), "7", "String presentation: Threshold #2"); | ||
a(d.toString(0, 3), "00", "String presentation: Threshold #3"); | ||
a(d.toString(0, 4), "0d", "String presentation: Threshold #4"); | ||
a(d.toString(0, 5), "0m", "String presentation: Threshold #5"); | ||
a(d.toString(0, 6), "0y", "String presentation: Threshold #6"); | ||
a(d.toString(0, 7), "0y", "String presentation: Threshold #7"); | ||
a(d.toString(1), "7m 12s 123ms", "String presentation #2"); | ||
a(d.toString(1, 0), "7m 12s 123ms", | ||
"String presentation #2: Threshold #0"); | ||
a(d.toString(1, 1), '7m 12s', "String presentation #2: Threshold #1"); | ||
a(d.toString(1, 2), '7m', "String presentation #2: Threshold #2"); | ||
a(d.toString(1, 3), '0h', "String presentation #2: Threshold #3"); | ||
a(d.toString(1, 4), '0d', "String presentation #2: Threshold #4"); | ||
a(d.toString(1, 5), '0m', "String presentation #2: Threshold #5"); | ||
a(d.toString(1, 6), '0y', "String presentation #2: Threshold #6"); | ||
a(d.toString(1, 7), '0y', "String presentation #2: Threshold #7"); | ||
a(d.toString(' %sign.%L.%Ls.%S.%Ss.%M.%Ms.%H.%Hs.%d.%ds.%m.%ms.%y '), | ||
' .123.' + (7 * 60 * 1000 + 12 * 1000 + 123) + '.12.' + (7 * 60 + 12) + | ||
'.07.7.00.0.00.0.00.0.0 ', "String presentation (custom)"); | ||
a(d.toString(1, 1), "7m 12s", "String presentation #2: Threshold #1"); | ||
a(d.toString(1, 2), "7m", "String presentation #2: Threshold #2"); | ||
a(d.toString(1, 3), "0h", "String presentation #2: Threshold #3"); | ||
a(d.toString(1, 4), "0d", "String presentation #2: Threshold #4"); | ||
a(d.toString(1, 5), "0m", "String presentation #2: Threshold #5"); | ||
a(d.toString(1, 6), "0y", "String presentation #2: Threshold #6"); | ||
a(d.toString(1, 7), "0y", "String presentation #2: Threshold #7"); | ||
a(d.toString(" %sign.%L.%Ls.%S.%Ss.%M.%Ms.%H.%Hs.%d.%ds.%m.%ms.%y "), | ||
" .123." + (7 * 60 * 1000 + 12 * 1000 + 123) + ".12." + (7 * 60 + 12) + | ||
".07.7.00.0.00.0.00.0.0 ", "String presentation (custom)"); | ||
@@ -277,32 +277,32 @@ d = t(d2, d1); | ||
a(d.toString(), '-07:12.123', "String presentation: Negative"); | ||
a(d.toString(0, 0), '-07:12.123', | ||
a(d.toString(), "-07:12.123", "String presentation: Negative"); | ||
a(d.toString(0, 0), "-07:12.123", | ||
"String presentation: Negative: Threshold #0"); | ||
a(d.toString(0, 1), '-07:12', | ||
a(d.toString(0, 1), "-07:12", | ||
"String presentation: Negative: Threshold #1"); | ||
a(d.toString(0, 2), '-7', "String presentation: Negative: Threshold #2"); | ||
a(d.toString(0, 3), '00', "String presentation: Negative: Threshold #3"); | ||
a(d.toString(0, 4), '0d', "String presentation: Negative: Threshold #4"); | ||
a(d.toString(0, 5), '0m', "String presentation: Negative: Threshold #5"); | ||
a(d.toString(0, 6), '0y', "String presentation: Negative: Threshold #6"); | ||
a(d.toString(1), '-7m 12s 123ms', "String presentation #2: Negative"); | ||
a(d.toString(1, 0), '-7m 12s 123ms', | ||
a(d.toString(0, 2), "-7", "String presentation: Negative: Threshold #2"); | ||
a(d.toString(0, 3), "00", "String presentation: Negative: Threshold #3"); | ||
a(d.toString(0, 4), "0d", "String presentation: Negative: Threshold #4"); | ||
a(d.toString(0, 5), "0m", "String presentation: Negative: Threshold #5"); | ||
a(d.toString(0, 6), "0y", "String presentation: Negative: Threshold #6"); | ||
a(d.toString(1), "-7m 12s 123ms", "String presentation #2: Negative"); | ||
a(d.toString(1, 0), "-7m 12s 123ms", | ||
"String presentation #2: Negative: Threshold #0"); | ||
a(d.toString(1, 1), '-7m 12s', | ||
a(d.toString(1, 1), "-7m 12s", | ||
"String presentation #2: Negative: Threshold #1"); | ||
a(d.toString(1, 2), '-7m', | ||
a(d.toString(1, 2), "-7m", | ||
"String presentation #2: Negative: Threshold #2"); | ||
a(d.toString(1, 3), '0h', | ||
a(d.toString(1, 3), "0h", | ||
"String presentation #2: Negative: Threshold #3"); | ||
a(d.toString(1, 4), '0d', | ||
a(d.toString(1, 4), "0d", | ||
"String presentation #2: Negative: Threshold #4"); | ||
a(d.toString(1, 5), '0m', | ||
a(d.toString(1, 5), "0m", | ||
"String presentation #2: Negative: Threshold #5"); | ||
a(d.toString(1, 6), '0y', | ||
a(d.toString(1, 6), "0y", | ||
"String presentation #2: Negative: Threshold #6"); | ||
a(d.toString(1, 7), '0y', | ||
a(d.toString(1, 7), "0y", | ||
"String presentation #2: Negative: Threshold #7"); | ||
a(d.toString(' %sign.%L.%Ls.%S.%Ss.%M.%Ms.%H.%Hs.%d.%ds.%m.%ms.%y '), | ||
' -.123.' + (7 * 60 * 1000 + 12 * 1000 + 123) + '.12.' + (7 * 60 + 12) + | ||
'.07.7.00.0.00.0.00.0.0 ', "String presentation (custom): Negative"); | ||
a(d.toString(" %sign.%L.%Ls.%S.%Ss.%M.%Ms.%H.%Hs.%d.%ds.%m.%ms.%y "), | ||
" -.123." + (7 * 60 * 1000 + 12 * 1000 + 123) + ".12." + (7 * 60 + 12) + | ||
".07.7.00.0.00.0.00.0.0 ", "String presentation (custom): Negative"); | ||
}, | ||
@@ -336,25 +336,25 @@ "Hours": function (a) { | ||
a(d.toString(), '04:07:12.123', "String presentation"); | ||
a(d.toString(0, 0), '04:07:12.123', "String presentation: Threshold #0"); | ||
a(d.toString(0, 1), '04:07:12', "String presentation: Threshold #1"); | ||
a(d.toString(0, 2), '04:07', "String presentation: Threshold #2"); | ||
a(d.toString(0, 3), '04', "String presentation: Threshold #3"); | ||
a(d.toString(0, 4), '0d', "String presentation: Threshold #4"); | ||
a(d.toString(0, 5), '0m', "String presentation: Threshold #5"); | ||
a(d.toString(0, 6), '0y', "String presentation: Threshold #6"); | ||
a(d.toString(0, 7), '0y', "String presentation: Threshold #7"); | ||
a(d.toString(1), '4h 7m 12s 123ms', "String presentation #2"); | ||
a(d.toString(1, 0), '4h 7m 12s 123ms', | ||
a(d.toString(), "04:07:12.123", "String presentation"); | ||
a(d.toString(0, 0), "04:07:12.123", "String presentation: Threshold #0"); | ||
a(d.toString(0, 1), "04:07:12", "String presentation: Threshold #1"); | ||
a(d.toString(0, 2), "04:07", "String presentation: Threshold #2"); | ||
a(d.toString(0, 3), "04", "String presentation: Threshold #3"); | ||
a(d.toString(0, 4), "0d", "String presentation: Threshold #4"); | ||
a(d.toString(0, 5), "0m", "String presentation: Threshold #5"); | ||
a(d.toString(0, 6), "0y", "String presentation: Threshold #6"); | ||
a(d.toString(0, 7), "0y", "String presentation: Threshold #7"); | ||
a(d.toString(1), "4h 7m 12s 123ms", "String presentation #2"); | ||
a(d.toString(1, 0), "4h 7m 12s 123ms", | ||
"String presentation #2: Threshold #0"); | ||
a(d.toString(1, 1), '4h 7m 12s', "String presentation #2: Threshold #1"); | ||
a(d.toString(1, 2), '4h 7m', "String presentation #2: Threshold #2"); | ||
a(d.toString(1, 3), '4h', "String presentation #2: Threshold #3"); | ||
a(d.toString(1, 4), '0d', "String presentation #2: Threshold #4"); | ||
a(d.toString(1, 5), '0m', "String presentation #2: Threshold #5"); | ||
a(d.toString(1, 6), '0y', "String presentation #2: Threshold #6"); | ||
a(d.toString(1, 7), '0y', "String presentation #2: Threshold #7"); | ||
a(d.toString(' %sign.%L.%Ls.%S.%Ss.%M.%Ms.%H.%Hs.%d.%ds.%m.%ms.%y '), | ||
' .123.' + (4 * 60 * 60 * 1000 + 7 * 60 * 1000 + 12 * 1000 + 123) + | ||
'.12.' + (4 * 60 * 60 + 7 * 60 + 12) + '.07.' + (4 * 60 + 7) + | ||
'.04.4.00.0.00.0.0 ', "String presentation (custom)"); | ||
a(d.toString(1, 1), "4h 7m 12s", "String presentation #2: Threshold #1"); | ||
a(d.toString(1, 2), "4h 7m", "String presentation #2: Threshold #2"); | ||
a(d.toString(1, 3), "4h", "String presentation #2: Threshold #3"); | ||
a(d.toString(1, 4), "0d", "String presentation #2: Threshold #4"); | ||
a(d.toString(1, 5), "0m", "String presentation #2: Threshold #5"); | ||
a(d.toString(1, 6), "0y", "String presentation #2: Threshold #6"); | ||
a(d.toString(1, 7), "0y", "String presentation #2: Threshold #7"); | ||
a(d.toString(" %sign.%L.%Ls.%S.%Ss.%M.%Ms.%H.%Hs.%d.%ds.%m.%ms.%y "), | ||
" .123." + (4 * 60 * 60 * 1000 + 7 * 60 * 1000 + 12 * 1000 + 123) + | ||
".12." + (4 * 60 * 60 + 7 * 60 + 12) + ".07." + (4 * 60 + 7) + | ||
".04.4.00.0.00.0.0 ", "String presentation (custom)"); | ||
@@ -381,35 +381,35 @@ d = t(d2, d1); | ||
a(d.toString(), '-04:07:12.123', "String presentation: Negative"); | ||
a(d.toString(0, 0), '-04:07:12.123', | ||
a(d.toString(), "-04:07:12.123", "String presentation: Negative"); | ||
a(d.toString(0, 0), "-04:07:12.123", | ||
"String presentation: Negative: Threshold #0"); | ||
a(d.toString(0, 1), '-04:07:12', | ||
a(d.toString(0, 1), "-04:07:12", | ||
"String presentation: Negative: Threshold #1"); | ||
a(d.toString(0, 2), '-04:07', | ||
a(d.toString(0, 2), "-04:07", | ||
"String presentation: Negative: Threshold #2"); | ||
a(d.toString(0, 3), '-04', "String presentation: Negative: Threshold #3"); | ||
a(d.toString(0, 4), '0d', "String presentation: Negative: Threshold #4"); | ||
a(d.toString(0, 5), '0m', "String presentation: Negative: Threshold #5"); | ||
a(d.toString(0, 6), '0y', "String presentation: Negative: Threshold #6"); | ||
a(d.toString(0, 7), '0y', "String presentation: Negative: Threshold #7"); | ||
a(d.toString(1), '-4h 7m 12s 123ms', "String presentation #2: Negative"); | ||
a(d.toString(1, 0), '-4h 7m 12s 123ms', | ||
a(d.toString(0, 3), "-04", "String presentation: Negative: Threshold #3"); | ||
a(d.toString(0, 4), "0d", "String presentation: Negative: Threshold #4"); | ||
a(d.toString(0, 5), "0m", "String presentation: Negative: Threshold #5"); | ||
a(d.toString(0, 6), "0y", "String presentation: Negative: Threshold #6"); | ||
a(d.toString(0, 7), "0y", "String presentation: Negative: Threshold #7"); | ||
a(d.toString(1), "-4h 7m 12s 123ms", "String presentation #2: Negative"); | ||
a(d.toString(1, 0), "-4h 7m 12s 123ms", | ||
"String presentation #2: Negative: Threshold #0"); | ||
a(d.toString(1, 1), '-4h 7m 12s', | ||
a(d.toString(1, 1), "-4h 7m 12s", | ||
"String presentation #2: Negative: Threshold #1"); | ||
a(d.toString(1, 2), '-4h 7m', | ||
a(d.toString(1, 2), "-4h 7m", | ||
"String presentation #2: Negative: Threshold #2"); | ||
a(d.toString(1, 3), '-4h', | ||
a(d.toString(1, 3), "-4h", | ||
"String presentation #2: Negative: Threshold #3"); | ||
a(d.toString(1, 4), '0d', | ||
a(d.toString(1, 4), "0d", | ||
"String presentation #2: Negative: Threshold #4"); | ||
a(d.toString(1, 5), '0m', | ||
a(d.toString(1, 5), "0m", | ||
"String presentation #2: Negative: Threshold #5"); | ||
a(d.toString(1, 6), '0y', | ||
a(d.toString(1, 6), "0y", | ||
"String presentation #2: Negative: Threshold #6"); | ||
a(d.toString(1, 7), '0y', | ||
a(d.toString(1, 7), "0y", | ||
"String presentation #2: Negative: Threshold #7"); | ||
a(d.toString(' %sign.%L.%Ls.%S.%Ss.%M.%Ms.%H.%Hs.%d.%ds.%m.%ms.%y '), | ||
' -.123.' + (4 * 60 * 60 * 1000 + 7 * 60 * 1000 + 12 * 1000 + 123) + | ||
'.12.' + (4 * 60 * 60 + 7 * 60 + 12) + '.07.' + (4 * 60 + 7) + | ||
'.04.4.00.0.00.0.0 ', "String presentation (custom): Negative"); | ||
a(d.toString(" %sign.%L.%Ls.%S.%Ss.%M.%Ms.%H.%Hs.%d.%ds.%m.%ms.%y "), | ||
" -.123." + (4 * 60 * 60 * 1000 + 7 * 60 * 1000 + 12 * 1000 + 123) + | ||
".12." + (4 * 60 * 60 + 7 * 60 + 12) + ".07." + (4 * 60 + 7) + | ||
".04.4.00.0.00.0.0 ", "String presentation (custom): Negative"); | ||
}, | ||
@@ -445,29 +445,29 @@ "Days": function (a) { | ||
a(d.toString(), '2d 14:07:12.123', "String presentation"); | ||
a(d.toString(0, 0), '2d 14:07:12.123', | ||
a(d.toString(), "2d 14:07:12.123", "String presentation"); | ||
a(d.toString(0, 0), "2d 14:07:12.123", | ||
"String presentation: Threshold #0"); | ||
a(d.toString(0, 1), '2d 14:07:12', "String presentation: Threshold #1"); | ||
a(d.toString(0, 2), '2d 14:07', "String presentation: Threshold #2"); | ||
a(d.toString(0, 3), '2d 14', "String presentation: Threshold #3"); | ||
a(d.toString(0, 4), '2d', "String presentation: Threshold #4"); | ||
a(d.toString(0, 5), '0m', "String presentation: Threshold #5"); | ||
a(d.toString(0, 6), '0y', "String presentation: Threshold #6"); | ||
a(d.toString(0, 7), '0y', "String presentation: Threshold #7"); | ||
a(d.toString(1), '2d 14h 7m 12s 123ms', "String presentation #2"); | ||
a(d.toString(1, 0), '2d 14h 7m 12s 123ms', | ||
a(d.toString(0, 1), "2d 14:07:12", "String presentation: Threshold #1"); | ||
a(d.toString(0, 2), "2d 14:07", "String presentation: Threshold #2"); | ||
a(d.toString(0, 3), "2d 14", "String presentation: Threshold #3"); | ||
a(d.toString(0, 4), "2d", "String presentation: Threshold #4"); | ||
a(d.toString(0, 5), "0m", "String presentation: Threshold #5"); | ||
a(d.toString(0, 6), "0y", "String presentation: Threshold #6"); | ||
a(d.toString(0, 7), "0y", "String presentation: Threshold #7"); | ||
a(d.toString(1), "2d 14h 7m 12s 123ms", "String presentation #2"); | ||
a(d.toString(1, 0), "2d 14h 7m 12s 123ms", | ||
"String presentation #2: Threshold #0"); | ||
a(d.toString(1, 1), '2d 14h 7m 12s', | ||
a(d.toString(1, 1), "2d 14h 7m 12s", | ||
"String presentation #2: Threshold #1"); | ||
a(d.toString(1, 2), '2d 14h 7m', "String presentation #2: Threshold #2"); | ||
a(d.toString(1, 3), '2d 14h', "String presentation #2: Threshold #3"); | ||
a(d.toString(1, 4), '2d', "String presentation #2: Threshold #4"); | ||
a(d.toString(1, 5), '0m', "String presentation #2: Threshold #5"); | ||
a(d.toString(1, 6), '0y', "String presentation #2: Threshold #6"); | ||
a(d.toString(1, 7), '0y', "String presentation #2: Threshold #7"); | ||
a(d.toString(' %sign.%L.%Ls.%S.%Ss.%M.%Ms.%H.%Hs.%d.%ds.%m.%ms.%y '), | ||
' .123.' + (2 * 24 * 60 * 60 * 1000 + 14 * 60 * 60 * 1000 + | ||
7 * 60 * 1000 + 12 * 1000 + 123) + '.12.' + | ||
(2 * 24 * 60 * 60 + 14 * 60 * 60 + 7 * 60 + 12) + '.07.' + | ||
(2 * 24 * 60 + 14 * 60 + 7) + '.14.' + (2 * 24 + 14) + | ||
'.02.2.00.0.0 ', "String presentation (custom)"); | ||
a(d.toString(1, 2), "2d 14h 7m", "String presentation #2: Threshold #2"); | ||
a(d.toString(1, 3), "2d 14h", "String presentation #2: Threshold #3"); | ||
a(d.toString(1, 4), "2d", "String presentation #2: Threshold #4"); | ||
a(d.toString(1, 5), "0m", "String presentation #2: Threshold #5"); | ||
a(d.toString(1, 6), "0y", "String presentation #2: Threshold #6"); | ||
a(d.toString(1, 7), "0y", "String presentation #2: Threshold #7"); | ||
a(d.toString(" %sign.%L.%Ls.%S.%Ss.%M.%Ms.%H.%Hs.%d.%ds.%m.%ms.%y "), | ||
" .123." + (2 * 24 * 60 * 60 * 1000 + 14 * 60 * 60 * 1000 + | ||
7 * 60 * 1000 + 12 * 1000 + 123) + ".12." + | ||
(2 * 24 * 60 * 60 + 14 * 60 * 60 + 7 * 60 + 12) + ".07." + | ||
(2 * 24 * 60 + 14 * 60 + 7) + ".14." + (2 * 24 + 14) + | ||
".02.2.00.0.0 ", "String presentation (custom)"); | ||
@@ -494,39 +494,39 @@ d = t(d2, d1); | ||
a(d.toString(), '-2d 14:07:12.123', "String presentation: Negative"); | ||
a(d.toString(0, 0), '-2d 14:07:12.123', | ||
a(d.toString(), "-2d 14:07:12.123", "String presentation: Negative"); | ||
a(d.toString(0, 0), "-2d 14:07:12.123", | ||
"String presentation: Negative: Threshold #0"); | ||
a(d.toString(0, 1), '-2d 14:07:12', | ||
a(d.toString(0, 1), "-2d 14:07:12", | ||
"String presentation: Negative: Threshold #1"); | ||
a(d.toString(0, 2), '-2d 14:07', | ||
a(d.toString(0, 2), "-2d 14:07", | ||
"String presentation: Negative: Threshold #2"); | ||
a(d.toString(0, 3), '-2d 14', | ||
a(d.toString(0, 3), "-2d 14", | ||
"String presentation: Negative: Threshold #3"); | ||
a(d.toString(0, 4), '-2d', "String presentation: Negative: Threshold #4"); | ||
a(d.toString(0, 5), '0m', "String presentation: Negative: Threshold #5"); | ||
a(d.toString(0, 6), '0y', "String presentation: Negative: Threshold #6"); | ||
a(d.toString(0, 7), '0y', "String presentation: Negative: Threshold #7"); | ||
a(d.toString(1), '-2d 14h 7m 12s 123ms', | ||
a(d.toString(0, 4), "-2d", "String presentation: Negative: Threshold #4"); | ||
a(d.toString(0, 5), "0m", "String presentation: Negative: Threshold #5"); | ||
a(d.toString(0, 6), "0y", "String presentation: Negative: Threshold #6"); | ||
a(d.toString(0, 7), "0y", "String presentation: Negative: Threshold #7"); | ||
a(d.toString(1), "-2d 14h 7m 12s 123ms", | ||
"String presentation #2: Negative"); | ||
a(d.toString(1, 0), '-2d 14h 7m 12s 123ms', | ||
a(d.toString(1, 0), "-2d 14h 7m 12s 123ms", | ||
"String presentation #2: Negative: Threshold #0"); | ||
a(d.toString(1, 1), '-2d 14h 7m 12s', | ||
a(d.toString(1, 1), "-2d 14h 7m 12s", | ||
"String presentation #2: Negative: Threshold #1"); | ||
a(d.toString(1, 2), '-2d 14h 7m', | ||
a(d.toString(1, 2), "-2d 14h 7m", | ||
"String presentation #2: Negative: Threshold #2"); | ||
a(d.toString(1, 3), '-2d 14h', | ||
a(d.toString(1, 3), "-2d 14h", | ||
"String presentation #2: Negative: Threshold #3"); | ||
a(d.toString(1, 4), '-2d', | ||
a(d.toString(1, 4), "-2d", | ||
"String presentation #2: Negative: Threshold #4"); | ||
a(d.toString(1, 5), '0m', | ||
a(d.toString(1, 5), "0m", | ||
"String presentation #2: Negative: Threshold #5"); | ||
a(d.toString(1, 6), '0y', | ||
a(d.toString(1, 6), "0y", | ||
"String presentation #2: Negative: Threshold #6"); | ||
a(d.toString(1, 7), '0y', | ||
a(d.toString(1, 7), "0y", | ||
"String presentation #2: Negative: Threshold #7"); | ||
a(d.toString(' %sign.%L.%Ls.%S.%Ss.%M.%Ms.%H.%Hs.%d.%ds.%m.%ms.%y '), | ||
' -.123.' + (2 * 24 * 60 * 60 * 1000 + 14 * 60 * 60 * 1000 + | ||
7 * 60 * 1000 + 12 * 1000 + 123) + '.12.' + | ||
(2 * 24 * 60 * 60 + 14 * 60 * 60 + 7 * 60 + 12) + '.07.' + | ||
(2 * 24 * 60 + 14 * 60 + 7) + '.14.' + (2 * 24 + 14) + | ||
'.02.2.00.0.0 ', "String presentation (custom): Negative"); | ||
a(d.toString(" %sign.%L.%Ls.%S.%Ss.%M.%Ms.%H.%Hs.%d.%ds.%m.%ms.%y "), | ||
" -.123." + (2 * 24 * 60 * 60 * 1000 + 14 * 60 * 60 * 1000 + | ||
7 * 60 * 1000 + 12 * 1000 + 123) + ".12." + | ||
(2 * 24 * 60 * 60 + 14 * 60 * 60 + 7 * 60 + 12) + ".07." + | ||
(2 * 24 * 60 + 14 * 60 + 7) + ".14." + (2 * 24 + 14) + | ||
".02.2.00.0.0 ", "String presentation (custom): Negative"); | ||
}, | ||
@@ -556,31 +556,31 @@ "Large duration": function (a) { | ||
a(d.toString(), '2y 2m 0d 00:00:00.000', "String presentation"); | ||
a(d.toString(0, 0), '2y 2m 0d 00:00:00.000', | ||
a(d.toString(), "2y 2m 0d 00:00:00.000", "String presentation"); | ||
a(d.toString(0, 0), "2y 2m 0d 00:00:00.000", | ||
"String presentation: Threshold #0"); | ||
a(d.toString(0, 1), '2y 2m 0d 00:00:00', | ||
a(d.toString(0, 1), "2y 2m 0d 00:00:00", | ||
"String presentation: Threshold #1"); | ||
a(d.toString(0, 2), '2y 2m 0d 00:00', | ||
a(d.toString(0, 2), "2y 2m 0d 00:00", | ||
"String presentation: Threshold #2"); | ||
a(d.toString(0, 3), '2y 2m 0d 00', "String presentation: Threshold #3"); | ||
a(d.toString(0, 4), '2y 2m 0d', "String presentation: Threshold #4"); | ||
a(d.toString(0, 5), '2y 2m', "String presentation: Threshold #5"); | ||
a(d.toString(0, 6), '2y', "String presentation: Threshold #6"); | ||
a(d.toString(0, 7), '2y', "String presentation: Threshold #7"); | ||
a(d.toString(1), '2y 2m 0d 0h 0m 0s 0ms', "String presentation #2"); | ||
a(d.toString(1, 0), '2y 2m 0d 0h 0m 0s 0ms', | ||
a(d.toString(0, 3), "2y 2m 0d 00", "String presentation: Threshold #3"); | ||
a(d.toString(0, 4), "2y 2m 0d", "String presentation: Threshold #4"); | ||
a(d.toString(0, 5), "2y 2m", "String presentation: Threshold #5"); | ||
a(d.toString(0, 6), "2y", "String presentation: Threshold #6"); | ||
a(d.toString(0, 7), "2y", "String presentation: Threshold #7"); | ||
a(d.toString(1), "2y 2m 0d 0h 0m 0s 0ms", "String presentation #2"); | ||
a(d.toString(1, 0), "2y 2m 0d 0h 0m 0s 0ms", | ||
"String presentation #2: Threshold #0"); | ||
a(d.toString(1, 1), '2y 2m 0d 0h 0m 0s', | ||
a(d.toString(1, 1), "2y 2m 0d 0h 0m 0s", | ||
"String presentation #2: Threshold #1"); | ||
a(d.toString(1, 2), '2y 2m 0d 0h 0m', | ||
a(d.toString(1, 2), "2y 2m 0d 0h 0m", | ||
"String presentation #2: Threshold #2"); | ||
a(d.toString(1, 3), '2y 2m 0d 0h', | ||
a(d.toString(1, 3), "2y 2m 0d 0h", | ||
"String presentation #2: Threshold #3"); | ||
a(d.toString(1, 4), '2y 2m 0d', "String presentation #2: Threshold #4"); | ||
a(d.toString(1, 5), '2y 2m', "String presentation #2: Threshold #5"); | ||
a(d.toString(1, 6), '2y', "String presentation #2: Threshold #6"); | ||
a(d.toString(1, 7), '2y', "String presentation #2: Threshold #7"); | ||
a(d.toString(' %sign.%L.%Ls.%S.%Ss.%M.%Ms.%H.%Hs.%d.%ds.%m.%ms.%y '), | ||
' .000.' + (days * 24 * 60 * 60 * 1000) + '.00.' + | ||
(days * 24 * 60 * 60) + '.00.' + (days * 24 * 60) + '.00.' + | ||
(days * 24) + '.00.' + days + '.02.' + 26 + '.2 ', | ||
a(d.toString(1, 4), "2y 2m 0d", "String presentation #2: Threshold #4"); | ||
a(d.toString(1, 5), "2y 2m", "String presentation #2: Threshold #5"); | ||
a(d.toString(1, 6), "2y", "String presentation #2: Threshold #6"); | ||
a(d.toString(1, 7), "2y", "String presentation #2: Threshold #7"); | ||
a(d.toString(" %sign.%L.%Ls.%S.%Ss.%M.%Ms.%H.%Hs.%d.%ds.%m.%ms.%y "), | ||
" .000." + (days * 24 * 60 * 60 * 1000) + ".00." + | ||
(days * 24 * 60 * 60) + ".00." + (days * 24 * 60) + ".00." + | ||
(days * 24) + ".00." + days + ".02." + 26 + ".2 ", | ||
"String presentation (custom)"); | ||
@@ -607,40 +607,40 @@ | ||
a(d.toString(), '-2y 2m 0d 00:00:00.000', | ||
a(d.toString(), "-2y 2m 0d 00:00:00.000", | ||
"String presentation: Negative"); | ||
a(d.toString(0, 0), '-2y 2m 0d 00:00:00.000', | ||
a(d.toString(0, 0), "-2y 2m 0d 00:00:00.000", | ||
"String presentation: Negative: Threshold #0"); | ||
a(d.toString(0, 1), '-2y 2m 0d 00:00:00', | ||
a(d.toString(0, 1), "-2y 2m 0d 00:00:00", | ||
"String presentation: Negative: Threshold #1"); | ||
a(d.toString(0, 2), '-2y 2m 0d 00:00', | ||
a(d.toString(0, 2), "-2y 2m 0d 00:00", | ||
"String presentation: Negative: Threshold #2"); | ||
a(d.toString(0, 3), '-2y 2m 0d 00', | ||
a(d.toString(0, 3), "-2y 2m 0d 00", | ||
"String presentation: Negative: Threshold #3"); | ||
a(d.toString(0, 4), '-2y 2m 0d', | ||
a(d.toString(0, 4), "-2y 2m 0d", | ||
"String presentation: Negative: Threshold #4"); | ||
a(d.toString(0, 5), '-2y 2m', | ||
a(d.toString(0, 5), "-2y 2m", | ||
"String presentation: Negative: Threshold #5"); | ||
a(d.toString(0, 6), '-2y', "String presentation: Negative: Threshold #6"); | ||
a(d.toString(0, 7), '-2y', "String presentation: Negative: Threshold #7"); | ||
a(d.toString(1), '-2y 2m 0d 0h 0m 0s 0ms', | ||
a(d.toString(0, 6), "-2y", "String presentation: Negative: Threshold #6"); | ||
a(d.toString(0, 7), "-2y", "String presentation: Negative: Threshold #7"); | ||
a(d.toString(1), "-2y 2m 0d 0h 0m 0s 0ms", | ||
"String presentation #2: Negative"); | ||
a(d.toString(1, 0), '-2y 2m 0d 0h 0m 0s 0ms', | ||
a(d.toString(1, 0), "-2y 2m 0d 0h 0m 0s 0ms", | ||
"String presentation #2: Negative: Threshold #0"); | ||
a(d.toString(1, 1), '-2y 2m 0d 0h 0m 0s', | ||
a(d.toString(1, 1), "-2y 2m 0d 0h 0m 0s", | ||
"String presentation #2: Negative: Threshold #1"); | ||
a(d.toString(1, 2), '-2y 2m 0d 0h 0m', | ||
a(d.toString(1, 2), "-2y 2m 0d 0h 0m", | ||
"String presentation #2: Negative: Threshold #2"); | ||
a(d.toString(1, 3), '-2y 2m 0d 0h', | ||
a(d.toString(1, 3), "-2y 2m 0d 0h", | ||
"String presentation #2: Negative: Threshold #3"); | ||
a(d.toString(1, 4), '-2y 2m 0d', | ||
a(d.toString(1, 4), "-2y 2m 0d", | ||
"String presentation #2: Negative: Threshold #4"); | ||
a(d.toString(1, 5), '-2y 2m', | ||
a(d.toString(1, 5), "-2y 2m", | ||
"String presentation #2: Negative: Threshold #5"); | ||
a(d.toString(1, 6), '-2y', | ||
a(d.toString(1, 6), "-2y", | ||
"String presentation #2: Negative: Threshold #6"); | ||
a(d.toString(1, 7), '-2y', | ||
a(d.toString(1, 7), "-2y", | ||
"String presentation #2: Negative: Threshold #7"); | ||
a(d.toString(' %sign.%L.%Ls.%S.%Ss.%M.%Ms.%H.%Hs.%d.%ds.%m.%ms.%y '), | ||
' -.000.' + (days * 24 * 60 * 60 * 1000) + '.00.' + | ||
(days * 24 * 60 * 60) + '.00.' + (days * 24 * 60) + '.00.' + | ||
(days * 24) + '.00.' + days + '.02.' + 26 + '.2 ', | ||
a(d.toString(" %sign.%L.%Ls.%S.%Ss.%M.%Ms.%H.%Hs.%d.%ds.%m.%ms.%y "), | ||
" -.000." + (days * 24 * 60 * 60 * 1000) + ".00." + | ||
(days * 24 * 60 * 60) + ".00." + (days * 24 * 60) + ".00." + | ||
(days * 24) + ".00." + days + ".02." + 26 + ".2 ", | ||
"String presentation (custom): Negative"); | ||
@@ -647,0 +647,0 @@ } |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
44071
188
3
8
752
- Removedd@0.1.1(transitive)
Updatedd@1
Updatedes5-ext@~0.10.23