Skip to content

Commit

Permalink
datecmp(): handle "bef" in $left; #111
Browse files Browse the repository at this point in the history
  • Loading branch information
nigelhorne committed Jun 5, 2024
1 parent 899c1be commit 1cecfff
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@ Magnific Popup http://dimsemenov.com/plugins/magnific-popup/
* [gedcom](https://github.com/nigelhorne/gedcom) - a general purpose utility for Gedcom files
* [gedcmp](https://github.com/nigelhorne/gedcmp) - compare two Gedcoms
* [lib](https://github.com/nigelhorne/lib) - library of routines used by this package
* [The Perl-GEDCOM Mailing List](https://www.miskatonic.org/pg/) - rather inactive mailing list
* [The Perl-GEDCOM Mailing List](https://www.miskatonic.org/pg/) - dead mailing list, you can check the archives

## LICENSE AND COPYRIGHT

Expand Down
12 changes: 8 additions & 4 deletions ged2site
Original file line number Diff line number Diff line change
Expand Up @@ -7504,7 +7504,7 @@ sub print_person
@phrases = ();
}

if($language eq 'English') {
if(($language eq 'English') && defined($bio)) {
if($ENV{'LANG'} =~ /^en_US/) {
$bio = Lingua::EN::ABC::b2a($bio);
$bio_dt->set(Lingua::EN::ABC::b2a($bio_dt->as_string()));
Expand Down Expand Up @@ -12559,14 +12559,18 @@ sub datecmp($$)
return 0 if($left eq $right);

if(!ref($left)) {
if($left =~ /^bef/i) {
if(($left =~ /^bef/i) || ($left =~ /^aft/i)) {
if($right =~ /^\d+$/) {
# For example, comparing bef 1 Jun 1965 <=> 1939
if($left =~ /\s(\d+)$/) {
return $1 <=> $right;
# Easy comparison for different years
if($1 != $right) {
return $1 <=> $right;
}
# FIXME: same year
}
}
print STDERR "$left <=> $right: Before not handled\n";
print STDERR "$left <=> $right: not handled yet\n";
my $i = 0;
while((my @call_details = caller($i++))) {
print STDERR "\t", colored($call_details[2] . ' of ' . $call_details[1], 'red'), "\n";
Expand Down

0 comments on commit 1cecfff

Please sign in to comment.