@ancon/wildcat-utils 1.41.10 → 1.41.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ancon/wildcat-utils",
|
|
3
|
-
"version": "1.41.
|
|
3
|
+
"version": "1.41.12",
|
|
4
4
|
"private": false,
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"module": "index.mjs",
|
|
@@ -981,6 +981,11 @@
|
|
|
981
981
|
"require": "./tables/index.js",
|
|
982
982
|
"types": "./tables/index.d.ts"
|
|
983
983
|
},
|
|
984
|
+
"./time/addDurationToTimeSpan": {
|
|
985
|
+
"import": "./time/addDurationToTimeSpan.mjs",
|
|
986
|
+
"require": "./time/addDurationToTimeSpan.js",
|
|
987
|
+
"types": "./time/addDurationToTimeSpan.d.ts"
|
|
988
|
+
},
|
|
984
989
|
"./time/getNextTenthMinute": {
|
|
985
990
|
"import": "./time/getNextTenthMinute.mjs",
|
|
986
991
|
"require": "./time/getNextTenthMinute.js",
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Function to add duration to a time span
|
|
3
|
+
*
|
|
4
|
+
* @param timeSpan The time span to add the duration
|
|
5
|
+
* @param duration The duration to add
|
|
6
|
+
* @returns The time span with the duration
|
|
7
|
+
*/
|
|
8
|
+
export default function addDurationToTimeSpan(timeSpan: string, // 'HH:mm:ss'
|
|
9
|
+
duration: string): string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const r=require("moment"),o=require("./getTimeSpanParts.js");function i(n,m){const e=o(n),s=o(m),t=r().startOf("day").hour(e.hours).minute(e.minutes).second(e.seconds??0).millisecond(0);return t.add({hours:s.hours,minutes:s.minutes,seconds:s.seconds}),t.format("HH:mm:ss")}module.exports=i;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import r from "moment";
|
|
2
|
+
import s from "./getTimeSpanParts.mjs";
|
|
3
|
+
function u(e, n) {
|
|
4
|
+
const o = s(e), t = s(n), m = r().startOf("day").hour(o.hours).minute(o.minutes).second(o.seconds ?? 0).millisecond(0);
|
|
5
|
+
return m.add({
|
|
6
|
+
hours: t.hours,
|
|
7
|
+
minutes: t.minutes,
|
|
8
|
+
seconds: t.seconds
|
|
9
|
+
}), m.format("HH:mm:ss");
|
|
10
|
+
}
|
|
11
|
+
export {
|
|
12
|
+
u as default
|
|
13
|
+
};
|
package/time/index.d.ts
CHANGED
|
@@ -2,4 +2,5 @@ import toMinutes from './toMinutes';
|
|
|
2
2
|
import getNextTenthMinute from './getNextTenthMinute';
|
|
3
3
|
import getPrevNthMinute from './getPrevNthMinute';
|
|
4
4
|
import getTimeSpanParts from './getTimeSpanParts';
|
|
5
|
-
|
|
5
|
+
import addDurationToTimeSpan from './addDurationToTimeSpan';
|
|
6
|
+
export { toMinutes, getNextTenthMinute, getTimeSpanParts, getPrevNthMinute, addDurationToTimeSpan, };
|
package/time/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./toMinutes.js"),t=require("./getNextTenthMinute.js"),i=require("./getPrevNthMinute.js"),r=require("./getTimeSpanParts.js");require("moment");exports.toMinutes=e;exports.getNextTenthMinute=t;exports.getPrevNthMinute=i;exports.getTimeSpanParts=r;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./toMinutes.js"),t=require("./getNextTenthMinute.js"),i=require("./getPrevNthMinute.js"),r=require("./getTimeSpanParts.js"),n=require("./addDurationToTimeSpan.js");require("moment");exports.toMinutes=e;exports.getNextTenthMinute=t;exports.getPrevNthMinute=i;exports.getTimeSpanParts=r;exports.addDurationToTimeSpan=n;
|
package/time/index.mjs
CHANGED
|
@@ -1,11 +1,13 @@
|
|
|
1
|
-
import { default as
|
|
1
|
+
import { default as o } from "./toMinutes.mjs";
|
|
2
2
|
import { default as f } from "./getNextTenthMinute.mjs";
|
|
3
3
|
import { default as m } from "./getPrevNthMinute.mjs";
|
|
4
|
-
import { default as
|
|
4
|
+
import { default as d } from "./getTimeSpanParts.mjs";
|
|
5
|
+
import { default as n } from "./addDurationToTimeSpan.mjs";
|
|
5
6
|
import "moment";
|
|
6
7
|
export {
|
|
8
|
+
n as addDurationToTimeSpan,
|
|
7
9
|
f as getNextTenthMinute,
|
|
8
10
|
m as getPrevNthMinute,
|
|
9
|
-
|
|
10
|
-
|
|
11
|
+
d as getTimeSpanParts,
|
|
12
|
+
o as toMinutes
|
|
11
13
|
};
|