@abaplint/runtime 2.12.15 → 2.12.17
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.
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { Structure } from "../types";
|
|
1
|
+
import { Packed, Structure } from "../types";
|
|
2
2
|
import { ICharacter } from "../types/_character";
|
|
3
3
|
type options = {
|
|
4
4
|
field?: ICharacter;
|
|
5
|
-
stamp?: ICharacter;
|
|
5
|
+
stamp?: ICharacter | Packed;
|
|
6
6
|
sy?: Structure;
|
|
7
7
|
};
|
|
8
8
|
export declare function getTime(options?: options): void;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.getTime = getTime;
|
|
4
|
+
const types_1 = require("../types");
|
|
4
5
|
function getTime(options) {
|
|
5
6
|
const d = new Date();
|
|
6
7
|
const date = d.getUTCFullYear() +
|
|
@@ -25,6 +26,13 @@ function getTime(options) {
|
|
|
25
26
|
}
|
|
26
27
|
if (options?.stamp) {
|
|
27
28
|
options.stamp.set(date + time);
|
|
29
|
+
if (options.stamp instanceof types_1.Packed && options.stamp.getDecimals() === 7) {
|
|
30
|
+
const str = (d.getUTCMilliseconds() + "").padStart(3, "0") + "0000";
|
|
31
|
+
// note: parsing to float will make it imprecise,
|
|
32
|
+
// ie. filling the nanoseconds part with garbage, which is what we want
|
|
33
|
+
const decimals = Number.parseFloat("0." + str);
|
|
34
|
+
options.stamp.set(options.stamp.get() + decimals);
|
|
35
|
+
}
|
|
28
36
|
}
|
|
29
37
|
}
|
|
30
38
|
//# sourceMappingURL=get_time.js.map
|