From b375204acc453e336c2ec3a0940bac1f45578da7 Mon Sep 17 00:00:00 2001 From: Sebastian Krupinski Date: Sat, 4 Jul 2026 18:26:53 -0400 Subject: [PATCH] refactor: use epoch time stamp Signed-off-by: Sebastian Krupinski --- lib/Providers/Personal/CollectionResource.php | 5 +++-- lib/Providers/Personal/EntityResource.php | 5 +++-- 2 files changed, 6 insertions(+), 4 deletions(-) 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());