Add safeguard against question marks entering NodaSplitTime

This commit is contained in:
Joshua Ramon Enslin 2024-08-02 03:41:51 +02:00
parent cc0997f412
commit dea09b17cd
Signed by: jrenslin
GPG Key ID: 46016F84501B70AE

View File

@ -338,11 +338,13 @@ final class NodaSplitTime {
// Calculate start date and end date
if (($this->before_after_indicator === NodaTimeBeforeAfterIndicator::before
|| $this->before_after_indicator === NodaTimeBeforeAfterIndicator::until)
|| $start_date === '?'
) {
$this->start_date = '-9999-12-31';
}
if (($this->before_after_indicator === NodaTimeBeforeAfterIndicator::after
|| $this->before_after_indicator === NodaTimeBeforeAfterIndicator::since)
|| $end_date === '?'
) {
$this->end_date = '9999-12-31';
}