diff --git a/src/Parser/Date.php b/src/Parser/Date.php index 9fb7f2e..b6edea9 100644 --- a/src/Parser/Date.php +++ b/src/Parser/Date.php @@ -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(); } }