Skip to content
Snippets Groups Projects
Commit 2ae71ea1 authored by mic29226's avatar mic29226
Browse files

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

fix(inputconverter): needed to rework the inputconverter to make sure all the dates in the distribution are 'dateTime' types
parent df9d608b
Branches datefixDEU
No related tags found
No related merge requests found
......@@ -110,10 +110,10 @@ function convertProperties(property, state, id, data, propertyKeys, dpiConfig) {
convertSingularStrings(subData, state, key);
} else if (formatType.singularURI[property].includes(key)) {
convertSingularURI(subData, state, key, dpiConfig);
} else if (formatType.multipleURI[property].includes(key)) {
convertMultipleURI(subData, state, key, property, dpiConfig);
} else if (formatType.singularURI[property].includes(key)) {
convertSingularURI(subData, state, key, dpiConfig);
} else if (formatType.typedStrings[property].includes(key)) {
convertTypedString(subData, state, key);
convertTypedString(subData, state, key, property);
} else if (formatType.multilingualStrings[property].includes(key)) {
convertMultilingual(subData, state, key);
} else if (formatType.conditionalProperties[property].includes(key)) {
......@@ -402,7 +402,7 @@ function convertMultipleURI(data, state, key, property, dpiConfig) {
* @param {*} state
* @param {*} key
*/
function convertTypedString(data, state, key) {
function convertTypedString(data, state, key, property) {
// some properties have a type
// 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) {
state["pv:distributionType"].lead = el.object.value;
} else {
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 };
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment