Skip to content

Commit

Permalink
Avoid "In 1914 he arrived in 1914"
Browse files Browse the repository at this point in the history
  • Loading branch information
nigelhorne committed Mar 7, 2024
1 parent b9d8e44 commit 24bbe2c
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions gedcom
Original file line number Diff line number Diff line change
Expand Up @@ -5576,7 +5576,9 @@ sub print_person
my @childnames;
foreach my $child(@children) {
if(($opts{'l'} || !is_alive(person => $child))) {
push(@childnames, $child->given_names());
my $given_names = $child->given_names();
$given_names =~ s/\.$//;
push(@childnames, $given_names);
}
}
if(scalar(@childnames)) {
Expand Down Expand Up @@ -10930,7 +10932,7 @@ sub journey

if($doa && ($doa =~ /(\d{3,4})$/)) {
$yoa = $1;
$doa =~ s/\s?\d{3,4}//;
$doa =~ s/\s+?\d{3,4}//;
if($dod && ($dod =~ /(\d{3,4})$/)) {
$yod = $1;
$dod =~ s/\s?\d{3,4}//;
Expand Down Expand Up @@ -10962,6 +10964,11 @@ sub journey
} else {
$rc = "In $year " . lc($rc);
}
if($year eq $doa) {
# Nothing more to print, avoid "In 1914 he arrived in 1914"
# But keep "In 1914 he arrived on 1 Jul"
undef $doa;
}
} else {
die 'TODO: ', $person->as_string(), ': handle departure only record';
# $yod = year({ person => $person, record => $departure });
Expand Down Expand Up @@ -11015,7 +11022,10 @@ sub journey
return "$rc, departing $dod";
}

return "$rc, arriving $doa";
if(defined($doa)) {
return "$rc, arriving $doa";
}
return $rc
}

sub count_descendants_at_level
Expand Down

0 comments on commit 24bbe2c

Please sign in to comment.