Skip to content

Commit

Permalink
Allow dates with the YYYY-MM
Browse files Browse the repository at this point in the history
  • Loading branch information
albarin committed Aug 25, 2024
1 parent 62d09e6 commit 177f13e
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/Parser/Date.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,10 @@ public static function parse(\Gedcom\Parser $parser)
return $dat->getYear().'-'.substr("0{$dat->getMonth()}", -2).'-'.substr("0{$dat->getDay()}", -2);
}

if ($dat->getYear() && $dat->getMonth()) {
return $dat->getYear().'-'.substr("0{$dat->getMonth()}", -2);
}

return $dat->getYear();
}
}

0 comments on commit 177f13e

Please sign in to comment.