Skip to content

Commit

Permalink
Copy descendents subroutine from gedcom
Browse files Browse the repository at this point in the history
  • Loading branch information
nigelhorne committed Aug 5, 2024
1 parent 7e03b8e commit 5432bc6
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions ged2site
Original file line number Diff line number Diff line change
Expand Up @@ -12490,6 +12490,31 @@ sub date_to_datetime
return; # undef
}

sub descendants
{
my $person = shift;

my @list;
if(my $l = shift) {
@list = @{$l};
}

# my @children = $person->children();
my @children = map { $_->children() } $person->fams();
if(scalar(@children)) {
foreach my $child(@children) {
push @list, $child;
# my @spouses = $child->spouse();
# if(scalar(@spouses)) {
# push @list, @spouses;
# }
@list = descendants($child, \@list);
}
}

return @list;
}

sub add_marker
{
my %params = (ref($_[0]) eq 'HASH') ? %{$_[0]} : @_;
Expand Down

0 comments on commit 5432bc6

Please sign in to comment.