From 10da57572fa9047465eddc892f083d9201250072 Mon Sep 17 00:00:00 2001 From: Alejandro Celaya Date: Sun, 16 Apr 2017 10:27:27 +0200 Subject: [PATCH] Fixed date format returned by the API --- .phpstorm.meta.php | 2 +- docs/swagger/paths/v1_authenticate.json | 5 +++++ docs/swagger/paths/v1_short-codes.json | 22 +++++++++++++++++++ .../CLI/src/Command/Api/ListKeysCommand.php | 2 +- module/Core/src/Entity/ShortUrl.php | 2 +- module/Core/src/Entity/Visit.php | 2 +- 6 files changed, 31 insertions(+), 4 deletions(-) diff --git a/.phpstorm.meta.php b/.phpstorm.meta.php index 1a5e12de..5acf91bd 100644 --- a/.phpstorm.meta.php +++ b/.phpstorm.meta.php @@ -1,7 +1,7 @@ {$formatMethod}($this->getEnabledSymbol($row)); } - $rowData[] = isset($expiration) ? $expiration->format(\DateTime::ISO8601) : '-'; + $rowData[] = isset($expiration) ? $expiration->format(\DateTime::ATOM) : '-'; $table->addRow($rowData); } diff --git a/module/Core/src/Entity/ShortUrl.php b/module/Core/src/Entity/ShortUrl.php index cf1ed87e..44e992ce 100644 --- a/module/Core/src/Entity/ShortUrl.php +++ b/module/Core/src/Entity/ShortUrl.php @@ -176,7 +176,7 @@ class ShortUrl extends AbstractEntity implements \JsonSerializable return [ 'shortCode' => $this->shortCode, 'originalUrl' => $this->originalUrl, - 'dateCreated' => isset($this->dateCreated) ? $this->dateCreated->format(\DateTime::ISO8601) : null, + 'dateCreated' => isset($this->dateCreated) ? $this->dateCreated->format(\DateTime::ATOM) : null, 'visitsCount' => count($this->visits), 'tags' => $this->tags->toArray(), ]; diff --git a/module/Core/src/Entity/Visit.php b/module/Core/src/Entity/Visit.php index a95c61b0..c1ab7333 100644 --- a/module/Core/src/Entity/Visit.php +++ b/module/Core/src/Entity/Visit.php @@ -171,7 +171,7 @@ class Visit extends AbstractEntity implements \JsonSerializable { return [ 'referer' => $this->referer, - 'date' => isset($this->date) ? $this->date->format(\DateTime::ISO8601) : null, + 'date' => isset($this->date) ? $this->date->format(\DateTime::ATOM) : null, 'remoteAddr' => $this->remoteAddr, 'userAgent' => $this->userAgent, 'visitLocation' => $this->visitLocation,