Fix broken time splitting for year ranges BC

This commit is contained in:
2024-05-04 01:17:33 +02:00
parent eb14615917
commit 7d303e219f
3 changed files with 23 additions and 1 deletions

View File

@ -928,6 +928,8 @@ final class NodaTimeSplitterTest extends TestCase {
'end_name' => "Februar 2004",
"start_year" => '2004',
"end_year" => '2004',
'start_date' => '2004-01-01',
'end_date' => '2004-02-31',
"counting_time_year" => "2004",
"counting_time_month" => "02",
"counting_time_day" => "01",
@ -942,6 +944,8 @@ final class NodaTimeSplitterTest extends TestCase {
'end_name' => "Februar 2004",
"start_year" => '2004',
"end_year" => '2004',
'start_date' => '2004-01-01',
'end_date' => '2004-02-31',
"counting_time_year" => "2004",
"counting_time_month" => "02",
"counting_time_day" => "01",
@ -963,6 +967,8 @@ final class NodaTimeSplitterTest extends TestCase {
'end_name' => "15.04.2019",
"start_year" => '2019',
"end_year" => '2019',
'start_date' => '2019-03-14',
'end_date' => '2019-04-15',
"counting_time_year" => "2019",
"counting_time_month" => "03",
"counting_time_day" => "30",
@ -976,6 +982,8 @@ final class NodaTimeSplitterTest extends TestCase {
'end_name' => "15.03.2019",
"start_year" => '2019',
"end_year" => '2019',
'start_date' => '2019-03-14',
'end_date' => '2019-03-15',
"counting_time_year" => "2019",
"counting_time_month" => "03",
"counting_time_day" => "15",
@ -990,6 +998,8 @@ final class NodaTimeSplitterTest extends TestCase {
'end_name' => "1900",
"start_year" => '1601',
"end_year" => '1900',
'start_date' => '1601-01-01',
'end_date' => '1900-12-31',
"counting_time_year" => "1751",
"counting_time_month" => "01",
"counting_time_day" => "01",
@ -1004,12 +1014,19 @@ final class NodaTimeSplitterTest extends TestCase {
'end_name' => "1969",
"start_year" => '1950',
"end_year" => '1969',
'start_date' => '1950-01-01',
'end_date' => '1969-12-31',
"counting_time_year" => "1960",
"counting_time_month" => "01",
"counting_time_day" => "01",
"counting_time_bcce" => "+",
]);
// Rewritten / 1950-60-as évek
$output = NodaTimeSplitter::attempt_splitting("1400-1100 v. Chr.");
self::assertEquals('-1400', $output->start_year);
self::assertEquals('-1400-01-01', $output->start_date);
}
/**