Datetime representation aligned for microformats2

Read more at http://microformats.org/

Also, tooltip text on time representation for humans has been improved.
Unfortunately no standardised representation (like "RFC850") had 4-digit years.
This commit is contained in:
Mikael Nordfeldth 2014-04-28 17:45:21 +02:00
parent 5fd6053220
commit b0cae37b0f
4 changed files with 14 additions and 9 deletions

View File

@ -109,8 +109,10 @@ abstract class MessageListItem extends Widget
'class' => 'timestamp', 'class' => 'timestamp',
'href' => $messageurl)); 'href' => $messageurl));
$dt = common_date_iso8601($this->message->created); $dt = common_date_iso8601($this->message->created);
$this->out->element('abbr', array('class' => 'published', $this->out->element('time', array('class' => 'dt-published',
'title' => $dt), 'datetime' => common_date_iso8601($this->message->created),
// TRANS: Timestamp title (tooltip text) for NoticeListItem
'title' => common_exact_date($this->message->created)),
common_date_string($this->message->created)); common_date_string($this->message->created));
$this->out->elementEnd('a'); $this->out->elementEnd('a');

View File

@ -370,9 +370,10 @@ class NoticeListItem extends Widget
$this->out->elementStart('a', array('rel' => 'bookmark', $this->out->elementStart('a', array('rel' => 'bookmark',
'class' => 'timestamp', 'class' => 'timestamp',
'href' => $noticeurl)); 'href' => $noticeurl));
$dt = common_date_iso8601($this->notice->created); $this->out->element('time', array('class' => 'dt-published',
$this->out->element('abbr', array('class' => 'published', 'datetime' => common_date_iso8601($this->notice->created),
'title' => $dt), // TRANS: Timestamp title (tooltip text) for NoticeListItem
'title' => common_exact_date($this->notice->created)),
common_date_string($this->notice->created)); common_date_string($this->notice->created));
$this->out->elementEnd('a'); $this->out->elementEnd('a');
} }

View File

@ -1393,7 +1393,8 @@ function common_exact_date($dt)
$dateStr = date('d F Y H:i:s', strtotime($dt)); $dateStr = date('d F Y H:i:s', strtotime($dt));
$d = new DateTime($dateStr, $_utc); $d = new DateTime($dateStr, $_utc);
$d->setTimezone($_siteTz); $d->setTimezone($_siteTz);
return $d->format(DATE_RFC850); // TRANS: Human-readable full date-time specification (formatting on http://php.net/date)
return $d->format(_('l, d-M-Y H:i:s T'));
} }
function common_date_w3dtf($dt) function common_date_w3dtf($dt)

View File

@ -99,9 +99,10 @@ class GroupMessageListItem extends Widget
$this->out->elementStart('a', array('rel' => 'bookmark', $this->out->elementStart('a', array('rel' => 'bookmark',
'class' => 'timestamp', 'class' => 'timestamp',
'href' => $this->gm->url)); 'href' => $this->gm->url));
$dt = common_date_iso8601($this->gm->created); $this->out->element('time', array('class' => 'dt-published',
$this->out->element('abbr', array('class' => 'published', 'datetime' => common_date_iso8601($this->gm->created),
'title' => $dt), // TRANS: Timestamp title (tooltip text) for NoticeListItem
'title' => common_exact_date($this->gm->created)),
common_date_string($this->gm->created)); common_date_string($this->gm->created));
$this->out->elementEnd('a'); $this->out->elementEnd('a');
$this->out->elementEnd('div'); $this->out->elementEnd('div');