Skip to content

Commit

Permalink
Detail information for UBHD GND Plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
dokempf committed Jul 25, 2024
1 parent 9b8f97f commit 8b21062
Showing 1 changed file with 18 additions and 1 deletion.
19 changes: 18 additions & 1 deletion src/components/fields/CustomDataTypeUBHDGND.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,26 @@
export let field;
const fdata = fieldData(data, table, field);
function extractYear(date) {
if (date) {
return date.split("-")[0];
}
return "";
}
function detailString(details) {
if (details.dateOfDeath) {
if (details.dateOfBirth) {
return ` (${extractYear(details.dateOfBirth)} - ${extractYear(details.dateOfDeath)})`;
}
return ` (? - ${extractYear(details.dateOfDeath)})`;
}
return "";
}
</script>

<span class="easydb-custom-ubhdgnd">
{fdata.conceptName}
{fdata.conceptName}{detailString(fdata.conceptDetails)}
<A href={fdata.conceptURI}>GND</A>
</span>

0 comments on commit 8b21062

Please sign in to comment.