Skip to content

Commit

Permalink
Handle more string types in datecmp()
Browse files Browse the repository at this point in the history
  • Loading branch information
nigelhorne committed Feb 1, 2025
1 parent 6386164 commit 99fb823
Showing 1 changed file with 24 additions and 1 deletion.
25 changes: 24 additions & 1 deletion gedcom
Original file line number Diff line number Diff line change
Expand Up @@ -12075,8 +12075,19 @@ sub datecmp($$)
}
}

# e.g. "1802 or 1803"
if($left =~ /(\d{3,4})/) {
my $start = $1;
if($right =~ /(\d{3,4})/) {
# e.g. 26 Aug 1744 <=> 1673-02-22T00:00:00
my $end = $1;
if($start != $end) {
return $start <=> $end;
}
}
}

if($left =~ /^(\d{3,4})\sor\s(\d{3,4})$/) {
# e.g. "1802 or 1803"
my($start, $end) = ($1, $2);
if($start == $end) {
complain("the years are the same '$left'");
Expand Down Expand Up @@ -12162,6 +12173,18 @@ sub datecmp($$)
return 0;
}
}

if($left =~ /(\d{3,4})/) {
my $start = $1;
if($right =~ /(\d{3,4})/) {
# e.g. 26 Aug 1744 <=> 1673-02-22T00:00:00
my $end = $1;
if($start != $end) {
return $start <=> $end;
}
}
}

# if(!$dfg->parse_datetime($right)) {
# my $i = 0;
# while((my @call_details = caller($i++))) {
Expand Down

0 comments on commit 99fb823

Please sign in to comment.