@abaplint/runtime 2.14.1 → 2.14.2
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/build/src/types/date.js
CHANGED
|
@@ -59,6 +59,10 @@ class Date {
|
|
|
59
59
|
return this.value;
|
|
60
60
|
}
|
|
61
61
|
getNumeric() {
|
|
62
|
+
// the initial date and content that is not a date, eg. blanks, convert to 0
|
|
63
|
+
if (this.value === "00000000" || /^\d{8}$/.test(this.value) === false) {
|
|
64
|
+
return 0;
|
|
65
|
+
}
|
|
62
66
|
return (0, _date_helper_1.getNumberFromDate)(this.value);
|
|
63
67
|
}
|
|
64
68
|
getOffset(input) {
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.DecFloat34 = void 0;
|
|
4
4
|
const _1 = require(".");
|
|
5
|
+
const date_1 = require("./date");
|
|
5
6
|
const hex_1 = require("./hex");
|
|
6
7
|
const xstring_1 = require("./xstring");
|
|
7
8
|
class DecFloat34 {
|
|
@@ -30,6 +31,10 @@ class DecFloat34 {
|
|
|
30
31
|
else if (value instanceof DecFloat34) {
|
|
31
32
|
this.value = value.getRaw();
|
|
32
33
|
}
|
|
34
|
+
else if (value instanceof date_1.Date) {
|
|
35
|
+
// d is converted to the number of days since 01.01.0001, not the YYYYMMDD digits
|
|
36
|
+
this.value = value.getNumeric();
|
|
37
|
+
}
|
|
33
38
|
else if (value instanceof _1.Float) {
|
|
34
39
|
this.value = value.getRaw();
|
|
35
40
|
}
|
package/build/src/types/float.js
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.Float = void 0;
|
|
4
4
|
const throw_error_1 = require("../throw_error");
|
|
5
|
+
const date_1 = require("./date");
|
|
5
6
|
const hex_1 = require("./hex");
|
|
6
7
|
const xstring_1 = require("./xstring");
|
|
7
8
|
const integer8_1 = require("./integer8");
|
|
@@ -77,6 +78,10 @@ class Float {
|
|
|
77
78
|
else if (value instanceof integer8_1.Integer8) {
|
|
78
79
|
this.value = Number(value.get());
|
|
79
80
|
}
|
|
81
|
+
else if (value instanceof date_1.Date) {
|
|
82
|
+
// d is converted to the number of days since 01.01.0001, not the YYYYMMDD digits
|
|
83
|
+
this.value = value.getNumeric();
|
|
84
|
+
}
|
|
80
85
|
else if (value instanceof Float || value instanceof decfloat34_1.DecFloat34) {
|
|
81
86
|
this.value = value.getRaw();
|
|
82
87
|
}
|
|
@@ -4,6 +4,7 @@ exports.Integer = exports.MIN_INTEGER = exports.MAX_INTEGER = exports.DIGITS = v
|
|
|
4
4
|
exports.toInteger = toInteger;
|
|
5
5
|
exports.roundHalfAwayFromZero = roundHalfAwayFromZero;
|
|
6
6
|
const throw_error_1 = require("../throw_error");
|
|
7
|
+
const date_1 = require("./date");
|
|
7
8
|
const float_1 = require("./float");
|
|
8
9
|
const hex_1 = require("./hex");
|
|
9
10
|
const xstring_1 = require("./xstring");
|
|
@@ -92,6 +93,10 @@ class Integer {
|
|
|
92
93
|
else if (value instanceof float_1.Float || value instanceof decfloat34_1.DecFloat34) {
|
|
93
94
|
this.set(roundHalfAwayFromZero(value.getRaw()));
|
|
94
95
|
}
|
|
96
|
+
else if (value instanceof date_1.Date) {
|
|
97
|
+
// d is converted to the number of days since 01.01.0001, not the YYYYMMDD digits
|
|
98
|
+
this.value = value.getNumeric();
|
|
99
|
+
}
|
|
95
100
|
else if (value instanceof hex_1.Hex || value instanceof xstring_1.XString || value instanceof hex_uint8_1.HexUInt8) {
|
|
96
101
|
// the last four bytes, 00 on the left, as a signed integer; an empty xstring is 0
|
|
97
102
|
const hex = value.get().slice(-8);
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.Integer8 = void 0;
|
|
4
4
|
const throw_error_1 = require("../throw_error");
|
|
5
|
+
const date_1 = require("./date");
|
|
5
6
|
const float_1 = require("./float");
|
|
6
7
|
const hex_1 = require("./hex");
|
|
7
8
|
const xstring_1 = require("./xstring");
|
|
@@ -46,6 +47,10 @@ class Integer8 {
|
|
|
46
47
|
}
|
|
47
48
|
this.value = BigInt(value);
|
|
48
49
|
}
|
|
50
|
+
else if (value instanceof date_1.Date) {
|
|
51
|
+
// d is converted to the number of days since 01.01.0001, not the YYYYMMDD digits
|
|
52
|
+
this.value = BigInt(value.getNumeric());
|
|
53
|
+
}
|
|
49
54
|
else if (value instanceof float_1.Float || value instanceof decfloat34_1.DecFloat34) {
|
|
50
55
|
this.set((0, integer_1.roundHalfAwayFromZero)(value.getRaw()));
|
|
51
56
|
}
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.Packed = void 0;
|
|
4
4
|
const float_1 = require("./float");
|
|
5
|
+
const date_1 = require("./date");
|
|
5
6
|
const throw_error_1 = require("../throw_error");
|
|
6
7
|
const integer8_1 = require("./integer8");
|
|
7
8
|
const decfloat34_1 = require("./decfloat34");
|
|
@@ -111,6 +112,10 @@ class Packed {
|
|
|
111
112
|
else if (value instanceof integer8_1.Integer8) {
|
|
112
113
|
this.value = value.get() * pow10(this.decimals);
|
|
113
114
|
}
|
|
115
|
+
else if (value instanceof date_1.Date) {
|
|
116
|
+
// d is converted to the number of days since 01.01.0001, not the YYYYMMDD digits
|
|
117
|
+
this.value = BigInt(value.getNumeric()) * pow10(this.decimals);
|
|
118
|
+
}
|
|
114
119
|
else if (value instanceof float_1.Float || value instanceof decfloat34_1.DecFloat34) {
|
|
115
120
|
this.value = this.numberToScaled(value.getRaw());
|
|
116
121
|
}
|