Compare commits

..

2 Commits

Author SHA1 Message Date
f03bde7c50
Make warning status limited in production / postproduction
relationship, if earliest postproduction is before earliest possible
production
2023-10-08 01:16:01 +02:00
11c61525e0
Improve parsing years in MDPlausiEvent 2023-10-07 22:38:27 +02:00
2 changed files with 22 additions and 6 deletions

View File

@ -265,13 +265,13 @@ final class MDPlausi {
*/
private function _evaluateProductionAfterPostproduction():void {
if ($this->_post_production->earliest_event_type !== 0
if ($this->_post_production->latest_event_type !== 0
&& $this->_production->earliest_event_type !== 0
&& $this->_post_production->earliest < $this->_production->earliest) {
&& $this->_post_production->latest < $this->_production->earliest) {
$message = $this->_tlLoader->tl("eventtype_name", "eventname", (string)$this->_post_production->earliest_event_type);
$message = $this->_tlLoader->tl("eventtype_name", "eventname", (string)$this->_post_production->latest_event_type);
$message .= $this->_post_production->formulateMessagePartForEarliest($this->_tlLoader);
$message .= $this->_post_production->formulateMessagePartForLatest($this->_tlLoader);
$message .= ' ' . strtolower($this->_tlLoader->tl("quality", "quality", "before")) . ' ' . $this->_tlLoader->tl("eventtype_name", "eventname", (string)$this->_production->earliest_event_type);
@ -282,6 +282,22 @@ final class MDPlausi {
}
else if ($this->_post_production->earliest_event_type !== 0
&& $this->_production->earliest_event_type !== 0
&& $this->_post_production->earliest < $this->_production->earliest) {
$message = $this->_tlLoader->tl("eventtype_name", "eventname", (string)$this->_post_production->earliest_event_type);
$message .= $this->_post_production->formulateMessagePartForEarliest($this->_tlLoader);
$message .= ' ' . strtolower($this->_tlLoader->tl("quality", "quality", "before_possibly")) . ' ' . $this->_tlLoader->tl("eventtype_name", "eventname", (string)$this->_production->earliest_event_type);
$message .= $this->_production->formulateMessagePartForEarliest($this->_tlLoader);
$this->_messageList[] = $message;
}
else if ($this->_post_production->earliest_event_type !== 0
&& $this->_production->latest_event_type !== 0
&& $this->_post_production->earliest < $this->_production->latest) {

View File

@ -37,8 +37,8 @@ final class MDPlausiEvent {
if (empty($time)) return ['earliest' => false, 'latest' => false];
// 2005
if (in_array(strlen($time), [4, 5], true) and is_numeric(substr($time, 1))) {
// 20, -1, 233, -233, 2005, -2005
if (in_array(strlen($time), [2, 3, 4, 5], true) and is_numeric(substr($time, 1))) {
return [
'earliest' => strtotime($time . '-01-01'),
'latest' => strtotime($time . '-12-31'),