Compare commits

..

No commits in common. "7f342ed3c4c516fec91ff1ca3bc9de19660071cb" and "ce480f8b9fe64a3c85b5f60360f3a331f2eafb52" have entirely different histories.

3 changed files with 1 additions and 23 deletions

View File

@ -330,7 +330,6 @@ final class NodaSplitTime {
$this->end_date = '9999-12-31'; $this->end_date = '9999-12-31';
} }
if (!isset($this->start_date) && false !== $start_date) { if (!isset($this->start_date) && false !== $start_date) {
$this->start_date = date("Y-m-d", MD_STD::strtotime($start_date)); $this->start_date = date("Y-m-d", MD_STD::strtotime($start_date));
} }

View File

@ -336,17 +336,13 @@ final class NodaTimeSplitter {
$start = \strval(-1 * \intval($output->end_year)); $start = \strval(-1 * \intval($output->end_year));
$end = \strval(-1 * \intval($output->start_year)); $end = \strval(-1 * \intval($output->start_year));
$start_date = $output->end_date;
$end_date = $output->start_date;
if (\intval($start) > \intval($end)) { if (\intval($start) > \intval($end)) {
$startToSet = $end; $startToSet = $end;
$end = $start; $end = $start;
$start = $startToSet; $start = $startToSet;
$start_date = $output->start_date;
$end_date = $output->end_date;
} }
return new NodaSplitTime($start, $end, $output->counting_time_month, $output->counting_time_day, return new NodaSplitTime($start, $end, $output->counting_time_month, $output->counting_time_day,
NodaCountingTimeIndicator::bce, $output->before_after_indicator, '-' . $start_date, '-' . $end_date); NodaCountingTimeIndicator::bce, $output->before_after_indicator, '-' . $output->end_date, '-' . $output->start_date);
} }
} }

View File

@ -928,8 +928,6 @@ final class NodaTimeSplitterTest extends TestCase {
'end_name' => "Februar 2004", 'end_name' => "Februar 2004",
"start_year" => '2004', "start_year" => '2004',
"end_year" => '2004', "end_year" => '2004',
'start_date' => '2004-01-01',
'end_date' => '2004-02-31',
"counting_time_year" => "2004", "counting_time_year" => "2004",
"counting_time_month" => "02", "counting_time_month" => "02",
"counting_time_day" => "01", "counting_time_day" => "01",
@ -944,8 +942,6 @@ final class NodaTimeSplitterTest extends TestCase {
'end_name' => "Februar 2004", 'end_name' => "Februar 2004",
"start_year" => '2004', "start_year" => '2004',
"end_year" => '2004', "end_year" => '2004',
'start_date' => '2004-01-01',
'end_date' => '2004-02-31',
"counting_time_year" => "2004", "counting_time_year" => "2004",
"counting_time_month" => "02", "counting_time_month" => "02",
"counting_time_day" => "01", "counting_time_day" => "01",
@ -967,8 +963,6 @@ final class NodaTimeSplitterTest extends TestCase {
'end_name' => "15.04.2019", 'end_name' => "15.04.2019",
"start_year" => '2019', "start_year" => '2019',
"end_year" => '2019', "end_year" => '2019',
'start_date' => '2019-03-14',
'end_date' => '2019-04-15',
"counting_time_year" => "2019", "counting_time_year" => "2019",
"counting_time_month" => "03", "counting_time_month" => "03",
"counting_time_day" => "30", "counting_time_day" => "30",
@ -982,8 +976,6 @@ final class NodaTimeSplitterTest extends TestCase {
'end_name' => "15.03.2019", 'end_name' => "15.03.2019",
"start_year" => '2019', "start_year" => '2019',
"end_year" => '2019', "end_year" => '2019',
'start_date' => '2019-03-14',
'end_date' => '2019-03-15',
"counting_time_year" => "2019", "counting_time_year" => "2019",
"counting_time_month" => "03", "counting_time_month" => "03",
"counting_time_day" => "15", "counting_time_day" => "15",
@ -998,8 +990,6 @@ final class NodaTimeSplitterTest extends TestCase {
'end_name' => "1900", 'end_name' => "1900",
"start_year" => '1601', "start_year" => '1601',
"end_year" => '1900', "end_year" => '1900',
'start_date' => '1601-01-01',
'end_date' => '1900-12-31',
"counting_time_year" => "1751", "counting_time_year" => "1751",
"counting_time_month" => "01", "counting_time_month" => "01",
"counting_time_day" => "01", "counting_time_day" => "01",
@ -1014,19 +1004,12 @@ final class NodaTimeSplitterTest extends TestCase {
'end_name' => "1969", 'end_name' => "1969",
"start_year" => '1950', "start_year" => '1950',
"end_year" => '1969', "end_year" => '1969',
'start_date' => '1950-01-01',
'end_date' => '1969-12-31',
"counting_time_year" => "1960", "counting_time_year" => "1960",
"counting_time_month" => "01", "counting_time_month" => "01",
"counting_time_day" => "01", "counting_time_day" => "01",
"counting_time_bcce" => "+", "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);
} }
/** /**