Skip to content

Commit

Permalink
Warn "Two dates of marriage, both of which are the same"
Browse files Browse the repository at this point in the history
  • Loading branch information
nigelhorne committed Sep 19, 2024
1 parent 2f24900 commit 27ed830
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions ged2site
Original file line number Diff line number Diff line change
Expand Up @@ -14103,7 +14103,12 @@ sub dateofmarriage
@d = $marriage->date();
}

if(scalar(@d) == 2) { # TODO: && dates not the same
if((scalar(@d) == 2) && (datecmp($d[0], $d[1]) == 0)) {
complain({ person => $person, warning => "Two dates of marriage, both of which are the same: $d[0]" });
pop(@d);
}

if(scalar(@d) == 2) {
my ($year1, $year2);

if($d[0] =~ /(\d{3,4})/) {
Expand Down Expand Up @@ -14135,7 +14140,7 @@ sub dateofmarriage
complain({ person => $person, warning => 'two dates of marriage, neither of which is marked primary' });
$dateofmarriage = $d[0];
}
} elsif(scalar(@d) == 1) { # TODO: || scalar == 2 && dates are the same, though warn then
} elsif(scalar(@d) == 1) {
$dateofmarriage = $d[0];
} elsif(scalar(@d)) {
complain({ person => $person, warning => [ 'TODO: handle more than 2 dates of marriage: ', conjunction(map { year(date => $_) } @d) ] });
Expand Down

0 comments on commit 27ed830

Please sign in to comment.