diff --git a/packages/piveau-hub-ui-modules/lib/data-provider-interface/utils/inputConverter.js b/packages/piveau-hub-ui-modules/lib/data-provider-interface/utils/inputConverter.js index 8fb48806a3220d9c0d98e094557133902f7c2efe..9e1d589487adc545f59d4e405253aa451599a2bc 100644 --- a/packages/piveau-hub-ui-modules/lib/data-provider-interface/utils/inputConverter.js +++ b/packages/piveau-hub-ui-modules/lib/data-provider-interface/utils/inputConverter.js @@ -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 }; } }