@abaplint/runtime 2.13.17 → 2.13.19
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.
|
@@ -4,11 +4,13 @@ export interface IConvertSource {
|
|
|
4
4
|
date?: ICharacter | string;
|
|
5
5
|
time?: ICharacter | string;
|
|
6
6
|
stamp?: ICharacter | INumeric | string;
|
|
7
|
+
utclong?: ICharacter | string;
|
|
7
8
|
zone: ICharacter | string;
|
|
8
9
|
}
|
|
9
10
|
export interface IConvertTarget {
|
|
10
11
|
stamp?: ICharacter;
|
|
11
12
|
date?: ICharacter;
|
|
12
13
|
time?: ICharacter;
|
|
14
|
+
utclong?: ICharacter;
|
|
13
15
|
}
|
|
14
16
|
export declare function convert(source: IConvertSource, target: IConvertTarget): void;
|
|
@@ -40,6 +40,16 @@ function convert(source, target) {
|
|
|
40
40
|
stamp = source.stamp.get() + "";
|
|
41
41
|
}
|
|
42
42
|
}
|
|
43
|
+
let utclong = "";
|
|
44
|
+
if (source.utclong) {
|
|
45
|
+
if (typeof source.utclong === "string") {
|
|
46
|
+
utclong = source.utclong;
|
|
47
|
+
}
|
|
48
|
+
else {
|
|
49
|
+
utclong = source.utclong.get() + "";
|
|
50
|
+
}
|
|
51
|
+
utclong = utclong.trim();
|
|
52
|
+
}
|
|
43
53
|
let zone = "";
|
|
44
54
|
if (source.zone) {
|
|
45
55
|
if (typeof source.zone === "string") {
|
|
@@ -57,7 +67,20 @@ function convert(source, target) {
|
|
|
57
67
|
}
|
|
58
68
|
////////////////////////
|
|
59
69
|
let zoned = undefined;
|
|
60
|
-
if (
|
|
70
|
+
if (utclong !== "") {
|
|
71
|
+
if (utclong === "0000-00-00 00:00:00.0000000") {
|
|
72
|
+
target.date?.clear();
|
|
73
|
+
target.time?.clear();
|
|
74
|
+
target.utclong?.clear();
|
|
75
|
+
return;
|
|
76
|
+
}
|
|
77
|
+
const datePart = utclong.substring(0, 10);
|
|
78
|
+
const timePart = utclong.substring(11, 19);
|
|
79
|
+
const pt = temporal_polyfill_1.Temporal.PlainTime.from(timePart);
|
|
80
|
+
zoned = temporal_polyfill_1.Temporal.PlainDate.from(datePart).toZonedDateTime({ timeZone: "UTC", plainTime: pt });
|
|
81
|
+
zoned = zoned.withTimeZone(zone);
|
|
82
|
+
}
|
|
83
|
+
else if (date !== "" && time !== "") {
|
|
61
84
|
if (date === "00000000" && time === "000000") {
|
|
62
85
|
target.stamp?.clear();
|
|
63
86
|
return;
|
|
@@ -87,6 +110,12 @@ function convert(source, target) {
|
|
|
87
110
|
if (target.time) {
|
|
88
111
|
target.time.set(t);
|
|
89
112
|
}
|
|
113
|
+
if (target.utclong) {
|
|
114
|
+
const targetDate = zoned.toPlainDate().toString();
|
|
115
|
+
const targetTime = zoned.toPlainTime().toString().substring(0, 8);
|
|
116
|
+
const fractionalSeconds = utclong !== "" ? utclong.substring(19) : ".0000000";
|
|
117
|
+
target.utclong.set(targetDate + " " + targetTime + fractionalSeconds);
|
|
118
|
+
}
|
|
90
119
|
if (utcUsed) {
|
|
91
120
|
abap.builtin.sy.get().subrc.set(4);
|
|
92
121
|
}
|