mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/Echo
synced 2024-11-23 15:36:58 +00:00
Make Echo use pretty timestamps
Change-Id: I1b061840c720ece80c1301f8ee38da9c80f7d100
This commit is contained in:
parent
92ba7da013
commit
acd4ee2102
|
@ -64,11 +64,13 @@ class ApiEchoNotifications extends ApiQueryBase {
|
|||
foreach( $res as $row ) {
|
||||
$event = EchoEvent::newFromRow( $row );
|
||||
|
||||
global $wgLang;
|
||||
$thisEvent = array(
|
||||
'type' => $event->getType(),
|
||||
'timestamp' => array(
|
||||
'unix' => wfTimestamp( TS_UNIX, $event->getTimestamp() ),
|
||||
'mw' => $event->getTimestamp(),
|
||||
'mw' => wfTimestamp( TS_MW, $event->getTimestamp() ),
|
||||
'pretty' => $wgLang->prettyTimestamp( $event->getTimestamp() ),
|
||||
),
|
||||
);
|
||||
|
||||
|
|
|
@ -5,4 +5,8 @@
|
|||
|
||||
.mw-echo-unread {
|
||||
background-color: #f9f9ff;
|
||||
}
|
||||
|
||||
div.mw-echo-timestamp {
|
||||
text-align: right;
|
||||
}
|
|
@ -34,6 +34,11 @@
|
|||
.data('id', id)
|
||||
.addClass('mw-echo-notification')
|
||||
.append(data['*'])
|
||||
.append(
|
||||
$('<div></div>')
|
||||
.text(data.timestamp.pretty)
|
||||
.addClass('mw-echo-timestamp')
|
||||
)
|
||||
.appendTo($ul);
|
||||
|
||||
if (! data.read ) {
|
||||
|
|
|
@ -45,7 +45,7 @@ class SpecialNotifications extends SpecialPage {
|
|||
$event = EchoEvent::newFromRow( $row );
|
||||
$class = 'mw-echo-notification';
|
||||
|
||||
$ts = $wgLang->timeanddate( $event->getTimestamp() );
|
||||
$ts = $wgLang->prettyTimestamp( $event->getTimestamp() );
|
||||
$formatted = "<span class='mw-echo-timestamp'>$ts</span> ";
|
||||
$formatted .= EchoNotificationController::formatNotification( $event, $wgUser, 'html' );
|
||||
|
||||
|
|
Loading…
Reference in a new issue