@ -345,6 +345,10 @@ final class NodaTimeSplitter {
|
||||
$start_date = $output->start_date;
|
||||
$end_date = $output->end_date;
|
||||
}
|
||||
else if ($start === $end && (int)str_replace('-', '', $start_date) > (int)str_replace('-', '', $end_date)) {
|
||||
$start_date = $output->start_date;
|
||||
$end_date = $output->end_date;
|
||||
}
|
||||
return new NodaSplitTime($start, $end, $output->counting_time_month, $output->counting_time_day,
|
||||
NodaCountingTimeIndicator::bce, $output->before_after_indicator, '-' . $start_date, '-' . $end_date);
|
||||
}
|
||||
@ -752,7 +756,7 @@ final class NodaTimeSplitter {
|
||||
return new NodaSplitTime($year, $year);
|
||||
}
|
||||
|
||||
if (str_starts_with($inpDateWoSpaces, '0-') || str_ends_with($inpDateWoSpaces, '-0') && \preg_match("/^[0-9]{4}$/", \strtr($inpDateWoSpaces, ['-0' => '', '0-' => '']))) {
|
||||
if ((str_starts_with($inpDateWoSpaces, '0-') || str_ends_with($inpDateWoSpaces, '-0')) && \preg_match("/^[0-9]{4}$/", \strtr($inpDateWoSpaces, ['-0' => '', '0-' => ''])) && !str_ends_with($inpDateWoSpaces, '0-0')) {
|
||||
$year = \strtr($inpDateWoSpaces, ['-0' => '', '0-' => '']);
|
||||
if (strlen($year) === 4) {
|
||||
return new NodaSplitTime($year, $year);
|
||||
|
Reference in New Issue
Block a user