Config to strip milliseconds from dateTime
This commit is contained in:
1 parent
6a9c62b639
commit
f7c1857b6a
4 files changed
+17
-6
No files matched your search
+7
-4
@@ -210,10 +210,13 @@ function SetParameterValues(xml, methodRequest) {
|
||||
for (const p of methodRequest.parameterList) {
|
||||
const pvs = paramList.node("ParameterValueStruct");
|
||||
pvs.node("Name").text(p[0]);
|
||||
if (p[2] === 'xsd:dateTime' && Number.isInteger(p[1]))
|
||||
pvs.node("Value").attr({"xsi:type": p[2]}).text((new Date(p[1])).toISOString());
|
||||
else
|
||||
pvs.node("Value").attr({"xsi:type": p[2]}).text(p[1]);
|
||||
let val = p[1];
|
||||
if (p[2] === 'xsd:dateTime' && typeof val === 'number') {
|
||||
val = (new Date(val)).toISOString();
|
||||
if (methodRequest.DATETIME_MILLISECONDS === false)
|
||||
val = val.replace('.000', '');
|
||||
}
|
||||
pvs.node("Value").attr({"xsi:type": p[2]}).text(val);
|
||||
}
|
||||
|
||||
el.node("ParameterKey").text(methodRequest.parameterKey || "");
|
||||
|
||||
Reference in new issue
Block a user