Skip to content
Snippets Groups Projects
Commit 4f484e3d authored by Michael  Peters's avatar Michael Peters
Browse files

Merge branch 'datefixDEU' into 'master'

fix(inputconverter): needed to rework the inputconverter to make sure all the...

See merge request piveau/ui/piveau-ui!225
parents f529194b 2ae71ea1
Branches widgetBFS
Tags
No related merge requests found
Pipeline #421473 failed
...@@ -110,10 +110,10 @@ function convertProperties(property, state, id, data, propertyKeys, dpiConfig) { ...@@ -110,10 +110,10 @@ function convertProperties(property, state, id, data, propertyKeys, dpiConfig) {
convertSingularStrings(subData, state, key); convertSingularStrings(subData, state, key);
} else if (formatType.singularURI[property].includes(key)) { } else if (formatType.singularURI[property].includes(key)) {
convertSingularURI(subData, state, key, dpiConfig); convertSingularURI(subData, state, key, dpiConfig);
} else if (formatType.multipleURI[property].includes(key)) { } else if (formatType.singularURI[property].includes(key)) {
convertMultipleURI(subData, state, key, property, dpiConfig); convertSingularURI(subData, state, key, dpiConfig);
} else if (formatType.typedStrings[property].includes(key)) { } else if (formatType.typedStrings[property].includes(key)) {
convertTypedString(subData, state, key); convertTypedString(subData, state, key, property);
} else if (formatType.multilingualStrings[property].includes(key)) { } else if (formatType.multilingualStrings[property].includes(key)) {
convertMultilingual(subData, state, key); convertMultilingual(subData, state, key);
} else if (formatType.conditionalProperties[property].includes(key)) { } else if (formatType.conditionalProperties[property].includes(key)) {
...@@ -402,7 +402,7 @@ function convertMultipleURI(data, state, key, property, dpiConfig) { ...@@ -402,7 +402,7 @@ function convertMultipleURI(data, state, key, property, dpiConfig) {
* @param {*} state * @param {*} state
* @param {*} key * @param {*} key
*/ */
function convertTypedString(data, state, key) { function convertTypedString(data, state, key, property) {
// some properties have a type // some properties have a type
// normally this type is not used within the forntend form and therefore won't be saved to frontend values // normally this type is not used within the forntend form and therefore won't be saved to frontend values
...@@ -419,9 +419,18 @@ function convertTypedString(data, state, key) { ...@@ -419,9 +419,18 @@ function convertTypedString(data, state, key) {
state["pv:distributionType"].lead = el.object.value; state["pv:distributionType"].lead = el.object.value;
} else { } else {
let dateType; let dateType;
if (el.object.value.includes("T")) dateType = "dateTime";
else dateType = "date";
if (el.object.value.includes("T")) {
dateType = "dateTime";
} else {
if (property === "distributions") {
dateType = "dateTime";
let newDateString = el.object.value + "T00:00:00";
console.log(newDateString);
state[key] = { "@type": dateType, "@value": newDateString };
break;
} else dateType = "date";
}
state[key] = { "@type": dateType, "@value": el.object.value }; state[key] = { "@type": dateType, "@value": el.object.value };
} }
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment