Fixed date format returned by the API

This commit is contained in:
Alejandro Celaya
2017-04-16 10:27:27 +02:00
parent 52478ca60a
commit 10da57572f
6 changed files with 31 additions and 4 deletions

View File

@@ -84,7 +84,7 @@ class ListKeysCommand extends Command
$rowData[] = $this->{$formatMethod}($this->getEnabledSymbol($row));
}
$rowData[] = isset($expiration) ? $expiration->format(\DateTime::ISO8601) : '-';
$rowData[] = isset($expiration) ? $expiration->format(\DateTime::ATOM) : '-';
$table->addRow($rowData);
}

View File

@@ -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(),
];

View File

@@ -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,