]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
Datetime representation aligned for microformats2
authorMikael Nordfeldth <mmn@hethane.se>
Mon, 28 Apr 2014 15:45:21 +0000 (17:45 +0200)
committerMikael Nordfeldth <mmn@hethane.se>
Mon, 28 Apr 2014 16:54:55 +0000 (18:54 +0200)
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.

lib/messagelistitem.php
lib/noticelistitem.php
lib/util.php
plugins/GroupPrivateMessage/lib/groupmessagelistitem.php

index 2590d7df634c9d76e4aa9042ef840f82f7fbe62c..cb9e546f0b7f6c964710ab4e4addb400fc56edb6 100644 (file)
@@ -109,8 +109,10 @@ abstract class MessageListItem extends Widget
                                             'class' => 'timestamp',
                                             'href' => $messageurl));
         $dt = common_date_iso8601($this->message->created);
-        $this->out->element('abbr', array('class' => 'published',
-                                          'title' => $dt),
+        $this->out->element('time', array('class' => 'dt-published',
+                                          '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));
         $this->out->elementEnd('a');
 
index 6aef97a1a4b8716000004215a76ec1d64b9ef022..e82331afede239e22d3b686aa8c99265a55700a3 100644 (file)
@@ -370,9 +370,10 @@ class NoticeListItem extends Widget
         $this->out->elementStart('a', array('rel' => 'bookmark',
                                             'class' => 'timestamp',
                                             'href' => $noticeurl));
-        $dt = common_date_iso8601($this->notice->created);
-        $this->out->element('abbr', array('class' => 'published',
-                                          'title' => $dt),
+        $this->out->element('time', array('class' => 'dt-published',
+                                          'datetime' => common_date_iso8601($this->notice->created),
+                                          // TRANS: Timestamp title (tooltip text) for NoticeListItem
+                                          'title' => common_exact_date($this->notice->created)),
                             common_date_string($this->notice->created));
         $this->out->elementEnd('a');
     }
index aa6a59c9aac3b8871abee5cd90d2a39c37555e92..8a259df7c1cc097b0ad61fae3c7f96bbafa53e65 100644 (file)
@@ -1393,7 +1393,8 @@ function common_exact_date($dt)
     $dateStr = date('d F Y H:i:s', strtotime($dt));
     $d = new DateTime($dateStr, $_utc);
     $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)
index 741d621c3282b9064afb73c47854d4d69db16b6c..ee0f147305521c9e0ec36f2163618393e9e27f17 100644 (file)
@@ -99,9 +99,10 @@ class GroupMessageListItem extends Widget
         $this->out->elementStart('a', array('rel' => 'bookmark',
                                             'class' => 'timestamp',
                                             'href' => $this->gm->url));
-        $dt = common_date_iso8601($this->gm->created);
-        $this->out->element('abbr', array('class' => 'published',
-                                          'title' => $dt),
+        $this->out->element('time', array('class' => 'dt-published',
+                                          'datetime' => common_date_iso8601($this->gm->created),
+                                          // TRANS: Timestamp title (tooltip text) for NoticeListItem
+                                          'title' => common_exact_date($this->gm->created)),
                             common_date_string($this->gm->created));
         $this->out->elementEnd('a');
         $this->out->elementEnd('div');