Skip to content

Commit

Permalink
Also consider 3-digit years (RPB-157)
Browse files Browse the repository at this point in the history
  • Loading branch information
fsteeg committed Apr 25, 2024
1 parent e0e6850 commit 50aed91
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion app/models/AuthorityResource.java
Original file line number Diff line number Diff line change
Expand Up @@ -562,6 +562,7 @@ private static String year(JsonNode node) {
return "";
}
String text = node.elements().next().asText();
return text.replaceAll(".*(\\d{4}).*", "$1");
return text.matches(".*\\d{4}.*") ? text.replaceAll(".*(\\d{4}).*", "$1")
: text.replaceAll(".*(\\d{3}).*", "$1");
}
}

0 comments on commit 50aed91

Please sign in to comment.