mirror of
https://github.com/OpenXE-org/OpenXE.git
synced 2024-11-14 12:07:15 +01:00
improved date format conversion with exception on ticket import with wrongly specified date
This commit is contained in:
parent
c0a9156f0e
commit
5408f197fd
@ -5,6 +5,7 @@ declare(strict_types=1);
|
||||
namespace Xentral\Components\MailClient\Data;
|
||||
|
||||
use DateTime;
|
||||
use DateTimeImmutable;
|
||||
use DateTimeInterface;
|
||||
use JsonSerializable;
|
||||
use Throwable;
|
||||
@ -307,11 +308,13 @@ final class MailMessageData implements MailMessageInterface, JsonSerializable
|
||||
if ($date === null) {
|
||||
return null;
|
||||
}
|
||||
$dateTime = date_create($date->getValue());
|
||||
/* $dateTime = date_create($date->getValue());
|
||||
if ($dateTime === false) {
|
||||
throw new InvalidArgumentException('Invalid date: '.$date->getValue());
|
||||
return null;
|
||||
}
|
||||
}*/
|
||||
|
||||
$dateTime = new DateTimeImmutable($date->getValue());
|
||||
|
||||
return $dateTime;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user