Compare commits

..

2 Commits

Author SHA1 Message Date
edadbe6cf5 4.0.5 2023-08-13 21:55:07 +02:00
58f213a099 fix(core): update 2023-08-13 21:55:06 +02:00
3 changed files with 9 additions and 2 deletions

View File

@ -1,7 +1,7 @@
{
"name": "@push.rocks/smarttime",
"private": false,
"version": "4.0.4",
"version": "4.0.5",
"description": "handle time in smart ways",
"main": "dist_ts/index.js",
"typings": "dist_ts/index.d.ts",

View File

@ -3,6 +3,6 @@
*/
export const commitinfo = {
name: '@push.rocks/smarttime',
version: '4.0.4',
version: '4.0.5',
description: 'handle time in smart ways'
}

View File

@ -19,6 +19,9 @@ export let units = {
minutes: (timesArg = 1) => {
return timesArg * 60000;
},
seconds: (timesArg = 1) => {
return timesArg * 1000;
},
};
export interface IUnitCombinationArg {
@ -28,6 +31,7 @@ export interface IUnitCombinationArg {
days?: number;
hours?: number;
minutes?: number;
seconds?: number;
}
export let getMilliSecondsFromUnits = (combinationArg: IUnitCombinationArg) => {
@ -53,6 +57,9 @@ export let getMilliSecondsFromUnits = (combinationArg: IUnitCombinationArg) => {
if (combinationArg.minutes) {
addMilliSeconds(units.minutes(combinationArg.minutes));
}
if (combinationArg.seconds) {
addMilliSeconds(units.seconds(combinationArg.seconds));
}
return timeInMilliseconds;
};