fix(core): update
This commit is contained in:
parent
1e5fd80a69
commit
58f213a099
@ -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'
|
||||
}
|
||||
|
@ -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;
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user