mirror of
https://github.com/friendica/friendica
synced 2024-11-11 08:22:54 +00:00
Renaming the date format to "JSON"
This commit is contained in:
parent
4e164690d5
commit
e7bc908655
5 changed files with 5 additions and 5 deletions
|
@ -108,7 +108,7 @@ class Account extends BaseDataTransferObject
|
||||||
$userContactCreated = $userContact['created'] ?? DBA::NULL_DATETIME;
|
$userContactCreated = $userContact['created'] ?? DBA::NULL_DATETIME;
|
||||||
|
|
||||||
$created = $userContactCreated < $publicContactCreated && ($userContactCreated != DBA::NULL_DATETIME) ? $userContactCreated : $publicContactCreated;
|
$created = $userContactCreated < $publicContactCreated && ($userContactCreated != DBA::NULL_DATETIME) ? $userContactCreated : $publicContactCreated;
|
||||||
$this->created_at = DateTimeFormat::utc($created, DateTimeFormat::API);
|
$this->created_at = DateTimeFormat::utc($created, DateTimeFormat::JSON);
|
||||||
|
|
||||||
$this->note = BBCode::convert($publicContact['about'], false);
|
$this->note = BBCode::convert($publicContact['about'], false);
|
||||||
$this->url = $publicContact['url'];
|
$this->url = $publicContact['url'];
|
||||||
|
|
|
@ -52,7 +52,7 @@ class Notification extends BaseDataTransferObject
|
||||||
{
|
{
|
||||||
$this->id = (string)$id;
|
$this->id = (string)$id;
|
||||||
$this->type = $type;
|
$this->type = $type;
|
||||||
$this->created_at = DateTimeFormat::utc($created_at, DateTimeFormat::API);
|
$this->created_at = DateTimeFormat::utc($created_at, DateTimeFormat::JSON);
|
||||||
$this->account = $account->toArray();
|
$this->account = $account->toArray();
|
||||||
|
|
||||||
if (!empty($status)) {
|
if (!empty($status)) {
|
||||||
|
|
|
@ -100,7 +100,7 @@ class Status extends BaseDataTransferObject
|
||||||
public function __construct(array $item, Account $account, Counts $counts, UserAttributes $userAttributes, bool $sensitive, Application $application, array $mentions, array $tags, Card $card, array $attachments, array $reblog)
|
public function __construct(array $item, Account $account, Counts $counts, UserAttributes $userAttributes, bool $sensitive, Application $application, array $mentions, array $tags, Card $card, array $attachments, array $reblog)
|
||||||
{
|
{
|
||||||
$this->id = (string)$item['uri-id'];
|
$this->id = (string)$item['uri-id'];
|
||||||
$this->created_at = DateTimeFormat::utc($item['created'], DateTimeFormat::API);
|
$this->created_at = DateTimeFormat::utc($item['created'], DateTimeFormat::JSON);
|
||||||
|
|
||||||
if ($item['gravity'] == GRAVITY_COMMENT) {
|
if ($item['gravity'] == GRAVITY_COMMENT) {
|
||||||
$this->in_reply_to_id = (string)$item['thr-parent-id'];
|
$this->in_reply_to_id = (string)$item['thr-parent-id'];
|
||||||
|
|
|
@ -53,6 +53,6 @@ class Token extends BaseDataTransferObject
|
||||||
$this->access_token = $access_token;
|
$this->access_token = $access_token;
|
||||||
$this->token_type = $token_type;
|
$this->token_type = $token_type;
|
||||||
$this->scope = $scope;
|
$this->scope = $scope;
|
||||||
$this->created_at = DateTimeFormat::utc($created_at, DateTimeFormat::API);
|
$this->created_at = DateTimeFormat::utc($created_at, DateTimeFormat::JSON);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -34,7 +34,7 @@ class DateTimeFormat
|
||||||
const ATOM = 'Y-m-d\TH:i:s\Z';
|
const ATOM = 'Y-m-d\TH:i:s\Z';
|
||||||
const MYSQL = 'Y-m-d H:i:s';
|
const MYSQL = 'Y-m-d H:i:s';
|
||||||
const HTTP = 'D, d M Y H:i:s \G\M\T';
|
const HTTP = 'D, d M Y H:i:s \G\M\T';
|
||||||
const API = 'Y-m-d\TH:i:s.v\Z';
|
const JSON = 'Y-m-d\TH:i:s.v\Z';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* convert() shorthand for UTC.
|
* convert() shorthand for UTC.
|
||||||
|
|
Loading…
Reference in a new issue