Comparing version 2.3.0 to 2.3.1
@@ -121,3 +121,3 @@ "use strict"; | ||
if (precision != "minutes") | ||
result = sum({ minutes: minutes % 60 }, fromSeconds(remainder * 60, { precision }), minutes < 60 ? {} : fromHours(Math.trunc(minutes / 60), { precision: "hours" })); | ||
result = sum({ minutes: minutes % 60 }, fromSeconds(remainder * 60, { precision }), Math.abs(minutes) < 60 ? {} : fromHours(Math.trunc(minutes / 60), { precision: "hours" })); | ||
else { | ||
@@ -137,3 +137,3 @@ const rounded = minutes + Math.round(remainder); | ||
if (precision != "seconds") | ||
result = sum({ seconds: seconds % 60 }, fromMilliseconds(remainder * 1000), seconds < 60 ? {} : fromMinutes(Math.trunc(seconds / 60), { precision: "minutes" })); | ||
result = sum({ seconds: seconds % 60 }, fromMilliseconds(remainder * 1000), Math.abs(seconds) < 60 ? {} : fromMinutes(Math.trunc(seconds / 60), { precision: "minutes" })); | ||
else { | ||
@@ -148,3 +148,3 @@ const rounded = seconds + Math.round(remainder); | ||
const rounded = Math.round(value); | ||
return sum({ milliseconds: rounded % 1000 }, rounded < 1000 ? {} : fromSeconds(Math.trunc(rounded / 1000), { precision: "seconds" })); | ||
return sum({ milliseconds: rounded % 1000 }, Math.abs(rounded) < 1000 ? {} : fromSeconds(Math.trunc(rounded / 1000), { precision: "seconds" })); | ||
} | ||
@@ -151,0 +151,0 @@ TimeSpan.fromMilliseconds = fromMilliseconds; |
@@ -91,3 +91,3 @@ export var TimeSpan; | ||
if (precision != "minutes") | ||
result = sum({ minutes: minutes % 60 }, fromSeconds(remainder * 60, { precision }), minutes < 60 ? {} : fromHours(Math.trunc(minutes / 60), { precision: "hours" })); | ||
result = sum({ minutes: minutes % 60 }, fromSeconds(remainder * 60, { precision }), Math.abs(minutes) < 60 ? {} : fromHours(Math.trunc(minutes / 60), { precision: "hours" })); | ||
else { | ||
@@ -106,3 +106,3 @@ const rounded = minutes + Math.round(remainder); | ||
if (precision != "seconds") | ||
result = sum({ seconds: seconds % 60 }, fromMilliseconds(remainder * 1000), seconds < 60 ? {} : fromMinutes(Math.trunc(seconds / 60), { precision: "minutes" })); | ||
result = sum({ seconds: seconds % 60 }, fromMilliseconds(remainder * 1000), Math.abs(seconds) < 60 ? {} : fromMinutes(Math.trunc(seconds / 60), { precision: "minutes" })); | ||
else { | ||
@@ -117,3 +117,3 @@ const rounded = seconds + Math.round(remainder); | ||
const rounded = Math.round(value); | ||
return sum({ milliseconds: rounded % 1000 }, rounded < 1000 ? {} : fromSeconds(Math.trunc(rounded / 1000), { precision: "seconds" })); | ||
return sum({ milliseconds: rounded % 1000 }, Math.abs(rounded) < 1000 ? {} : fromSeconds(Math.trunc(rounded / 1000), { precision: "seconds" })); | ||
} | ||
@@ -120,0 +120,0 @@ TimeSpan.fromMilliseconds = fromMilliseconds; |
{ | ||
"name": "isoly", | ||
"version": "2.3.0", | ||
"version": "2.3.1", | ||
"description": "Datatypes and functions specified by ISO-standards.", | ||
@@ -5,0 +5,0 @@ "author": "Utily Contributors", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
1871730