Support BCE / CE times

This commit is contained in:
jrenslin committed 2023-10-15 19:20:16 +02:00
1 parent 9942c58b12
commit 37715bc3e8
2 files changed
+39 -1

No files matched your search

+3 -1
View File
@@ -66,6 +66,8 @@ final class NodaTimeSplitter {
// To clean
"v.Chr." => "v. Chr.",
"v. Chr" => "v. Chr.",
"BCE" => "v. Chr.",
"CE" => "",
"vor Christus" => "v. Chr.",
];
@@ -399,7 +401,7 @@ final class NodaTimeSplitter {
$datum = self::clean_input($datum);
if (\preg_match("/\ v\.\ Chr\.$/", $datum)) {
if (\str_ends_with($datum, ' v. Chr.')) {
if ($output = self::attempt_splitting(\substr($datum, 0, -8))) {
$start = \strval(-1 * \intval($output[1]));
$end = \strval(-1 * \intval($output[0]));