Skip to content

Commit

Permalink
Complain if date of birth is 0xxx
Browse files Browse the repository at this point in the history
  • Loading branch information
nigelhorne committed Apr 10, 2024
1 parent 5bfb96f commit 382c590
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions ged2site
Original file line number Diff line number Diff line change
Expand Up @@ -12784,10 +12784,9 @@ sub dateofbirth {
if($d[1] =~ /(\d{3,4})/) {
$year2 = $1;
}
if(defined($year1) && defined($year2)) {
if(abs($year1 - $year2) > 30) {
complain({ person => $person, warning => 'More than one date of birth separated by many years' });
}

if((defined($year1) && defined($year2)) && (abs($year1 - $year2) > 30)) {
complain({ person => $person, warning => 'More than one date of birth separated by many years' });
}

# Get the primary date.
Expand Down Expand Up @@ -12849,6 +12848,10 @@ sub dateofbirth {
complain({ person => $person, warning => "Removing trailing spaces from date of birth '$dateofbirth'" });
$dateofbirth =~ s/\s+$//;
}
if($dateofbirth =~ /^0\d{3}/) {
complain({ person => $person, warning => "Removing leading zeroes from date of birth '$dateofbirth'" });
$dateofbirth =~ s/^0+//;
}
return parse_date({ date => $dateofbirth, type => 'Birth', person => $person });
}
return; # return undef
Expand Down

0 comments on commit 382c590

Please sign in to comment.