Skip to content

Commit cd4e0a3

Browse files
committed
Parse milliseconds in date-time values
1 parent cd4a0d0 commit cd4e0a3

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/Schema/Field/DateTime.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,11 @@ public function __construct(string $name)
1919
$this->deserialize(static function ($value) {
2020
if (
2121
is_string($value) &&
22-
($date = \DateTime::createFromFormat(DateTimeInterface::RFC3339, $value))
22+
(($date = \DateTime::createFromFormat(DateTimeInterface::RFC3339, $value)) ||
23+
($date = \DateTime::createFromFormat(
24+
DateTimeInterface::RFC3339_EXTENDED,
25+
$value,
26+
)))
2327
) {
2428
return $date;
2529
}

0 commit comments

Comments
 (0)