Skip to content

Commit

Permalink
Add additional fallback for publication date #1886
Browse files Browse the repository at this point in the history
Suggested by #1806 (comment)
  • Loading branch information
TobiasNx committed Sep 19, 2023
1 parent 204bc36 commit 6f176fc
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions src/main/resources/alma/fix/titleRelatedFields.fix
Original file line number Diff line number Diff line change
Expand Up @@ -285,6 +285,22 @@ if exists("publication[].$first")
end
end
end
unless exists("publication[].$first.startDate[]")
if any_match("008","^.{6}[brestikm](\\d{4}).*$")
copy_field("008","@008startDate")
replace_all("@008startDate","^.{7}(\\d{4}).*$","$1")
copy_field("@008startDate","publication[].$first.startDate")
end
end
unless exists("publication[].$first.endDate[]")
if any_match("008","^.{6}[km]\\d{4}(\\d{4}).*$")
copy_field("008","@008endDate")
replace_all("@008endDate","^.{11}(\\d{4}).*$","$1")
unless any_equal("@008endDate","9999")
copy_field("@008endDate","publication[].$first.endDate")
end
end
end
end


Expand Down

0 comments on commit 6f176fc

Please sign in to comment.