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 18, 2023
1 parent deb2f1e commit c1c7788
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 @@ -275,6 +275,13 @@ 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[]")
do list(path:"260[ 3][ 1]", "var":"$i")
do list(path: "$i.c", "var":"$j")
Expand All @@ -287,6 +294,15 @@ if exists("publication[].$first")
end
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
unless exists("publication[].$first.location[].1")
do list(path:"260[ 3][ 1]", "var":"$i")
copy_field("$i.a", "publication[].$first.location[].$append")
Expand Down

0 comments on commit c1c7788

Please sign in to comment.