diff --git a/src/Result/Item/Participant.php b/src/Result/Item/Participant.php index 17f02dd..6d87f1f 100644 --- a/src/Result/Item/Participant.php +++ b/src/Result/Item/Participant.php @@ -199,7 +199,12 @@ class Participant extends BaseItem break; case 'completed': - $this->completed = 'Y' === trim(strtoupper($value)); + if ('N' === trim(strtoupper($value))) { + $this->completed = false; + break; + } + + $this->completed = Date::isValidDate($value, true); break; case 'usesleft': diff --git a/tests/Result/Item/ParticipantTest.php b/tests/Result/Item/ParticipantTest.php index eddd4e9..b45b61c 100644 --- a/tests/Result/Item/ParticipantTest.php +++ b/tests/Result/Item/ParticipantTest.php @@ -200,7 +200,7 @@ class ParticipantTest extends BaseTestCase 'sent' => 'Y', 'remindersent' => 'N', 'remindercount' => 1, - 'completed' => 'Y', + 'completed' => (new DateTime())->format('Y-m-d H:i'), 'usesleft' => 5, 'validfrom' => (new DateTime())->format('Y-m-d H:i:s'), 'validuntil' => null,