mirror of
https://github.com/OpenXE-org/OpenXE.git
synced 2024-12-25 06:00:28 +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;
|
namespace Xentral\Components\MailClient\Data;
|
||||||
|
|
||||||
use DateTime;
|
use DateTime;
|
||||||
|
use DateTimeImmutable;
|
||||||
use DateTimeInterface;
|
use DateTimeInterface;
|
||||||
use JsonSerializable;
|
use JsonSerializable;
|
||||||
use Throwable;
|
use Throwable;
|
||||||
@ -307,11 +308,13 @@ final class MailMessageData implements MailMessageInterface, JsonSerializable
|
|||||||
if ($date === null) {
|
if ($date === null) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
$dateTime = date_create($date->getValue());
|
/* $dateTime = date_create($date->getValue());
|
||||||
if ($dateTime === false) {
|
if ($dateTime === false) {
|
||||||
throw new InvalidArgumentException('Invalid date: '.$date->getValue());
|
throw new InvalidArgumentException('Invalid date: '.$date->getValue());
|
||||||
return null;
|
return null;
|
||||||
}
|
}*/
|
||||||
|
|
||||||
|
$dateTime = new DateTimeImmutable($date->getValue());
|
||||||
|
|
||||||
return $dateTime;
|
return $dateTime;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user