This commit is contained in:
Efstratios Giannopoulos 2024-06-03 14:31:44 +03:00
parent b525ea3437
commit 4c34f1f606
1 changed files with 3 additions and 2 deletions

View File

@ -80,8 +80,9 @@ public class ZenodoBuilder {
org.opencdmp.commonmodels.models.dmpblueprint.FieldModel fieldOfSemantic = this.getFieldOfSemantic(dmp, SEMANTIC_PUBLICATION_DATE);
if (fieldOfSemantic != null){
DmpBlueprintValueModel dmpBlueprintValueModel = this.getDmpBlueprintValue(dmp, fieldOfSemantic.getId());
if (dmpBlueprintValueModel != null && dmpBlueprintValueModel.getValue() != null && !dmpBlueprintValueModel.getValue().isBlank()){
if (dmpBlueprintValueModel != null && dmpBlueprintValueModel.getDateValue() != null) {
deposit.getMetadata().setPublicationDate(DateTimeFormatter.ofPattern("yyyy-MM-dd").withZone(ZoneId.systemDefault()).format(dmpBlueprintValueModel.getDateValue()));
} else if (dmpBlueprintValueModel != null && dmpBlueprintValueModel.getValue() != null && !dmpBlueprintValueModel.getValue().isBlank()){
try {
Instant instant = Instant.parse(dmpBlueprintValueModel.getValue());
deposit.getMetadata().setPublicationDate(DateTimeFormatter.ofPattern("yyyy-MM-dd").withZone(ZoneId.systemDefault()).format(instant));