@colijnit/ioneconnector 254.1.3 → 255.1.1
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.
|
@@ -2,7 +2,4 @@ export declare class DateUtils {
|
|
|
2
2
|
static StringAsDate(str: string): Date;
|
|
3
3
|
static GetDaysFromNow(date: Date): number;
|
|
4
4
|
static GetDayDifference(from: Date, to: Date): number;
|
|
5
|
-
static IsToday(date: Date): boolean;
|
|
6
|
-
static IsSameDay(dateOne: Date, dateTwo: Date): boolean;
|
|
7
|
-
static IsInBetween(date: Date, startDate: Date, endDate: Date, withTime?: boolean): boolean;
|
|
8
5
|
}
|
|
@@ -20,27 +20,6 @@ class DateUtils {
|
|
|
20
20
|
}
|
|
21
21
|
return ((to.getTime() - from.getTime()) / 1000 / 60 / 60 / 24);
|
|
22
22
|
}
|
|
23
|
-
static IsToday(date) {
|
|
24
|
-
const today = new Date();
|
|
25
|
-
return DateUtils.IsSameDay(today, date);
|
|
26
|
-
}
|
|
27
|
-
static IsSameDay(dateOne, dateTwo) {
|
|
28
|
-
return (dateOne && dateTwo &&
|
|
29
|
-
dateOne.getDate() === dateTwo.getDate()
|
|
30
|
-
&& dateOne.getMonth() === dateTwo.getMonth()
|
|
31
|
-
&& dateOne.getFullYear() === dateTwo.getFullYear());
|
|
32
|
-
}
|
|
33
|
-
static IsInBetween(date, startDate, endDate, withTime = true) {
|
|
34
|
-
if (startDate && endDate) {
|
|
35
|
-
if (withTime) {
|
|
36
|
-
return (date > startDate && date < endDate);
|
|
37
|
-
}
|
|
38
|
-
else {
|
|
39
|
-
const dateWithoutTime = new Date(date).setHours(0, 0, 0, 0), dateFromWithoutTime = new Date(startDate).setHours(0, 0, 0, 0), dateToWithoutTime = new Date(endDate).setHours(0, 0, 0, 0);
|
|
40
|
-
return dateWithoutTime >= dateFromWithoutTime && dateWithoutTime <= dateToWithoutTime;
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
23
|
}
|
|
45
24
|
exports.DateUtils = DateUtils;
|
|
46
25
|
//# sourceMappingURL=date-utils.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"date-utils.js","sourceRoot":"","sources":["../../src/utils/date-utils.ts"],"names":[],"mappings":";;;AAAA,oEAAqD;AAGrD,MAAa,SAAS;IACX,MAAM,CAAC,YAAY,CAAC,GAAW;QAClC,IAAI,IAAA,2BAAO,EAAC,GAAG,CAAC,EAAE;YACd,OAAO,IAAI,IAAI,CAAC,GAAG,CAAC,CAAC;SACxB;aAAM;YACH,OAAO,SAAS,CAAC;SACpB;IACL,CAAC;IAEM,MAAM,CAAC,cAAc,CAAC,IAAU;QACnC,OAAO,SAAS,CAAC,gBAAgB,CAAC,IAAI,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC,EAAE,IAAI,CAAC,CAAC;IAClE,CAAC;IAEM,MAAM,CAAC,gBAAgB,CAAC,IAAU,EAAE,EAAQ;QAC/C,IAAI,CAAC,IAAI,IAAI,CAAC,EAAE,EAAE;YACd,OAAO,GAAG,CAAC;SACd;QACD,OAAO,CAAC,CAAC,EAAE,CAAC,OAAO,EAAE,GAAG,IAAI,CAAC,OAAO,EAAE,CAAC,GAAG,IAAI,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC,CAAC;IACnE,CAAC;
|
|
1
|
+
{"version":3,"file":"date-utils.js","sourceRoot":"","sources":["../../src/utils/date-utils.ts"],"names":[],"mappings":";;;AAAA,oEAAqD;AAGrD,MAAa,SAAS;IACX,MAAM,CAAC,YAAY,CAAC,GAAW;QAClC,IAAI,IAAA,2BAAO,EAAC,GAAG,CAAC,EAAE;YACd,OAAO,IAAI,IAAI,CAAC,GAAG,CAAC,CAAC;SACxB;aAAM;YACH,OAAO,SAAS,CAAC;SACpB;IACL,CAAC;IAEM,MAAM,CAAC,cAAc,CAAC,IAAU;QACnC,OAAO,SAAS,CAAC,gBAAgB,CAAC,IAAI,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC,EAAE,IAAI,CAAC,CAAC;IAClE,CAAC;IAEM,MAAM,CAAC,gBAAgB,CAAC,IAAU,EAAE,EAAQ;QAC/C,IAAI,CAAC,IAAI,IAAI,CAAC,EAAE,EAAE;YACd,OAAO,GAAG,CAAC;SACd;QACD,OAAO,CAAC,CAAC,EAAE,CAAC,OAAO,EAAE,GAAG,IAAI,CAAC,OAAO,EAAE,CAAC,GAAG,IAAI,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC,CAAC;IACnE,CAAC;CACJ;AAnBD,8BAmBC"}
|
|
@@ -1,6 +1,4 @@
|
|
|
1
1
|
export declare class RefCodeUtils {
|
|
2
2
|
static Check(valueToCheck: number, powTwoNumToCheckAgainst: number): boolean;
|
|
3
3
|
static CheckAny(valueToCheck: number, ...powTwoNumsToCheckAgainst: number[]): boolean;
|
|
4
|
-
static GetMultiRefCodeChoices(multiRefCode: number): number[];
|
|
5
|
-
static GetNumbersArraySum(numbersArray: number[]): number;
|
|
6
4
|
}
|
|
@@ -15,32 +15,6 @@ class RefCodeUtils {
|
|
|
15
15
|
}
|
|
16
16
|
return false;
|
|
17
17
|
}
|
|
18
|
-
static GetMultiRefCodeChoices(multiRefCode) {
|
|
19
|
-
const choices = [];
|
|
20
|
-
let powTwoExponent = 22;
|
|
21
|
-
let powTwoVal = Math.pow(2, powTwoExponent);
|
|
22
|
-
let remainder = multiRefCode;
|
|
23
|
-
while (remainder > 0) {
|
|
24
|
-
if (remainder - powTwoVal >= 0) {
|
|
25
|
-
choices.push(powTwoVal);
|
|
26
|
-
remainder -= powTwoVal;
|
|
27
|
-
}
|
|
28
|
-
powTwoExponent--;
|
|
29
|
-
powTwoVal = Math.pow(2, powTwoExponent);
|
|
30
|
-
}
|
|
31
|
-
choices.reverse();
|
|
32
|
-
return choices;
|
|
33
|
-
}
|
|
34
|
-
static GetNumbersArraySum(numbersArray) {
|
|
35
|
-
if (!Array.isArray(numbersArray) || numbersArray.length === 0) {
|
|
36
|
-
return;
|
|
37
|
-
}
|
|
38
|
-
let sum = 0;
|
|
39
|
-
numbersArray.forEach((num) => {
|
|
40
|
-
sum += num;
|
|
41
|
-
});
|
|
42
|
-
return sum;
|
|
43
|
-
}
|
|
44
18
|
}
|
|
45
19
|
exports.RefCodeUtils = RefCodeUtils;
|
|
46
20
|
//# sourceMappingURL=ref-code-utils.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ref-code-utils.js","sourceRoot":"","sources":["../../src/utils/ref-code-utils.ts"],"names":[],"mappings":";;;AAAA,iDAA2C;AAG3C,MAAa,YAAY;IAGd,MAAM,CAAC,KAAK,CAAC,YAAoB,EAAE,uBAA+B;QACrE,OAAO,0BAAW,CAAC,6BAA6B,CAAC,YAAY,EAAE,uBAAuB,CAAC,CAAC;IAC5F,CAAC;IAMM,MAAM,CAAC,QAAQ,CAAC,YAAoB,EAAE,GAAG,wBAAkC;QAC9E,MAAM,GAAG,GAAW,wBAAwB,CAAC,MAAM,CAAC;QACpD,KAAK,IAAI,CAAC,GAAW,CAAC,EAAE,CAAC,GAAG,GAAG,EAAE,CAAC,EAAE,EAAE;YAClC,IAAI,YAAY,CAAC,KAAK,CAAC,YAAY,EAAE,wBAAwB,CAAC,CAAC,CAAC,CAAC,EAAE;gBAC/D,OAAO,IAAI,CAAC;aACf;SACJ;QACD,OAAO,KAAK,CAAC;IACjB,CAAC;
|
|
1
|
+
{"version":3,"file":"ref-code-utils.js","sourceRoot":"","sources":["../../src/utils/ref-code-utils.ts"],"names":[],"mappings":";;;AAAA,iDAA2C;AAG3C,MAAa,YAAY;IAGd,MAAM,CAAC,KAAK,CAAC,YAAoB,EAAE,uBAA+B;QACrE,OAAO,0BAAW,CAAC,6BAA6B,CAAC,YAAY,EAAE,uBAAuB,CAAC,CAAC;IAC5F,CAAC;IAMM,MAAM,CAAC,QAAQ,CAAC,YAAoB,EAAE,GAAG,wBAAkC;QAC9E,MAAM,GAAG,GAAW,wBAAwB,CAAC,MAAM,CAAC;QACpD,KAAK,IAAI,CAAC,GAAW,CAAC,EAAE,CAAC,GAAG,GAAG,EAAE,CAAC,EAAE,EAAE;YAClC,IAAI,YAAY,CAAC,KAAK,CAAC,YAAY,EAAE,wBAAwB,CAAC,CAAC,CAAC,CAAC,EAAE;gBAC/D,OAAO,IAAI,CAAC;aACf;SACJ;QACD,OAAO,KAAK,CAAC;IACjB,CAAC;CACJ;AApBD,oCAoBC"}
|