fix serialized dates from API (#1888)

This commit is contained in:
Kevin Papst
2020-08-12 21:56:47 +02:00
committed by GitHub
parent dc9bc8a8ca
commit 2449a1e8bf
6 changed files with 118 additions and 5 deletions

View File

@@ -114,6 +114,9 @@ class Timesheet implements EntityWithMetaFields, ExportItemInterface
* @Serializer\Expose()
* @Serializer\Groups({"Default"})
* @Serializer\Type(name="DateTime")
* @Serializer\Accessor(getter="getBegin")
*
* Attention: Accessor MUST be used, otherwise date will be serialized in UTC.
*
* @ORM\Column(name="start_time", type="datetime", nullable=false)
* @Assert\NotNull()
@@ -125,6 +128,9 @@ class Timesheet implements EntityWithMetaFields, ExportItemInterface
* @Serializer\Expose()
* @Serializer\Groups({"Default"})
* @Serializer\Type(name="DateTime")
* @Serializer\Accessor(getter="getEnd")
*
* Attention: Accessor MUST be used, otherwise date will be serialized in UTC.
*
* @ORM\Column(name="end_time", type="datetime", nullable=true)
*/