@appolo/utils
Advanced tools
Comparing version 8.0.15 to 8.0.16
@@ -36,2 +36,12 @@ "use strict"; | ||
} | ||
static milisecHuman(ms) { | ||
let str = ''; | ||
let date = new Date(ms), days = date.getUTCDate() - 1, hours = date.getUTCHours(), minutes = date.getUTCMinutes(), seconds = date.getUTCSeconds(), milli = date.getUTCMilliseconds(); | ||
days && (str += `${days} days, `); | ||
(hours || str) && (str += `${hours} hours, `); | ||
(minutes || str) && (str += `${minutes} minutes, `); | ||
(seconds || str) && (str += `${seconds} seconds, `); | ||
str += `${milli} milli`; | ||
return str; | ||
} | ||
static durationIntToString(durationSeconds) { | ||
@@ -38,0 +48,0 @@ return new Date(durationSeconds * 1000).toISOString().substr(11, 8); |
@@ -49,2 +49,20 @@ import {Numbers} from "../index"; | ||
public static milisecHuman(ms: number): string { | ||
let str = ''; | ||
let date = new Date(ms), | ||
days = date.getUTCDate() - 1, | ||
hours = date.getUTCHours(), | ||
minutes = date.getUTCMinutes(), | ||
seconds = date.getUTCSeconds(), | ||
milli = date.getUTCMilliseconds(); | ||
days && (str += `${days} days, `); | ||
(hours || str) && (str += `${hours} hours, `); | ||
(minutes || str) && (str += `${minutes} minutes, `); | ||
(seconds || str) && (str += `${seconds} seconds, `); | ||
str += `${milli} milli`; | ||
return str; | ||
} | ||
public static durationIntToString(durationSeconds: number): string { | ||
@@ -75,3 +93,3 @@ return new Date(durationSeconds * 1000).toISOString().substr(11, 8); | ||
delay +=(params.min || 0); | ||
delay += (params.min || 0); | ||
@@ -78,0 +96,0 @@ if (params.max) { |
@@ -20,3 +20,3 @@ { | ||
"main": "./index.js", | ||
"version": "8.0.15", | ||
"version": "8.0.16", | ||
"license": "MIT", | ||
@@ -23,0 +23,0 @@ "repository": { |
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
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
184572
3304