diff --git a/lib/Providers/Personal/CollectionResource.php b/lib/Providers/Personal/CollectionResource.php index c0f1b33..ab1ab11 100644 --- a/lib/Providers/Personal/CollectionResource.php +++ b/lib/Providers/Personal/CollectionResource.php @@ -11,6 +11,7 @@ namespace KTXM\ProviderLocalChrono\Providers\Personal; use KTXF\Chrono\Collection\CollectionMutableAbstract; use KTXF\Resource\Identifier\CollectionIdentifier; +use KTXF\Utile\Timestamp; class CollectionResource extends CollectionMutableAbstract { @@ -73,8 +74,8 @@ class CollectionResource extends CollectionMutableAbstract { 'rank' => $properties->getRank(), 'visibility' => $properties->getVisibility(), 'color' => $properties->getColor(), - 'createdOn' => $this->data[self::PROPERTY_CREATED] ?? null, - 'modifiedOn' => $this->data[self::PROPERTY_MODIFIED] ?? null, + 'createdOn' => Timestamp::normalize($this->data[self::PROPERTY_CREATED] ?? null), + 'modifiedOn' => Timestamp::normalize($this->data[self::PROPERTY_MODIFIED] ?? null), 'signature' => $this->data[self::PROPERTY_SIGNATURE] ?? null, 'enabled' => $this->collectionEnabled, ], static fn($value) => $value !== null); diff --git a/lib/Providers/Personal/EntityResource.php b/lib/Providers/Personal/EntityResource.php index 10d46da..1ad984f 100644 --- a/lib/Providers/Personal/EntityResource.php +++ b/lib/Providers/Personal/EntityResource.php @@ -11,6 +11,7 @@ namespace KTXM\ProviderLocalChrono\Providers\Personal; use KTXF\Chrono\Entity\EntityMutableAbstract; use KTXF\Chrono\Event\EventObject; +use KTXF\Utile\Timestamp; class EntityResource extends EntityMutableAbstract { @@ -49,8 +50,8 @@ class EntityResource extends EntityMutableAbstract { 'uid' => $this->userId, 'cid' => $this->collection(), 'eid' => $this->identifier(), - 'createdOn' => $this->data[self::PROPERTY_CREATED] ?? date('c'), - 'modifiedOn' => date('c'), + 'createdOn' => Timestamp::normalize($this->data[self::PROPERTY_CREATED] ?? null), + 'modifiedOn' => Timestamp::normalize($this->data[self::PROPERTY_MODIFIED] ?? null), ], static fn($value) => $value !== null); $document = array_merge($document, $this->getProperties()->toStore());