Skip to content

Commit 79b7c7a

Browse files
committed
zenodo - use edition date for publication, if no publication date available
1 parent 14c7e1a commit 79b7c7a

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

inst/actions/zen4R_deposit_record.R

+7-1
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,13 @@ function(action, entity, config){
217217

218218
#date
219219
pubDates <- entity$dates[sapply(entity$dates, function(date){date$key == "publication"})]
220-
date <- if(length(pubDates)>0) pubDates[[1]]$value else entity$dates[[1]]$value
220+
edDates <- entity$dates[sapply(entity$dates, function(date){date$key == "edition"})]
221+
date <- entity$dates[[1]]$value
222+
if(length(pubDates)>0){
223+
date = pubDates[[1]]$value
224+
}else{
225+
date = edDates[[1]]$value
226+
}
221227
zenodo_metadata$setPublicationDate(date)
222228
#version (mapped to geoflow descriptions edition)
223229
edition = entity$descriptions[["edition"]]

0 commit comments

Comments
 (0)