mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/Echo
synced 2024-11-23 23:44:53 +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 ) {
|
foreach( $res as $row ) {
|
||||||
$event = EchoEvent::newFromRow( $row );
|
$event = EchoEvent::newFromRow( $row );
|
||||||
|
|
||||||
|
global $wgLang;
|
||||||
$thisEvent = array(
|
$thisEvent = array(
|
||||||
'type' => $event->getType(),
|
'type' => $event->getType(),
|
||||||
'timestamp' => array(
|
'timestamp' => array(
|
||||||
'unix' => wfTimestamp( TS_UNIX, $event->getTimestamp() ),
|
'unix' => wfTimestamp( TS_UNIX, $event->getTimestamp() ),
|
||||||
'mw' => $event->getTimestamp(),
|
'mw' => wfTimestamp( TS_MW, $event->getTimestamp() ),
|
||||||
|
'pretty' => $wgLang->prettyTimestamp( $event->getTimestamp() ),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
|
@ -6,3 +6,7 @@
|
||||||
.mw-echo-unread {
|
.mw-echo-unread {
|
||||||
background-color: #f9f9ff;
|
background-color: #f9f9ff;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
div.mw-echo-timestamp {
|
||||||
|
text-align: right;
|
||||||
|
}
|
|
@ -34,6 +34,11 @@
|
||||||
.data('id', id)
|
.data('id', id)
|
||||||
.addClass('mw-echo-notification')
|
.addClass('mw-echo-notification')
|
||||||
.append(data['*'])
|
.append(data['*'])
|
||||||
|
.append(
|
||||||
|
$('<div></div>')
|
||||||
|
.text(data.timestamp.pretty)
|
||||||
|
.addClass('mw-echo-timestamp')
|
||||||
|
)
|
||||||
.appendTo($ul);
|
.appendTo($ul);
|
||||||
|
|
||||||
if (! data.read ) {
|
if (! data.read ) {
|
||||||
|
|
|
@ -45,7 +45,7 @@ class SpecialNotifications extends SpecialPage {
|
||||||
$event = EchoEvent::newFromRow( $row );
|
$event = EchoEvent::newFromRow( $row );
|
||||||
$class = 'mw-echo-notification';
|
$class = 'mw-echo-notification';
|
||||||
|
|
||||||
$ts = $wgLang->timeanddate( $event->getTimestamp() );
|
$ts = $wgLang->prettyTimestamp( $event->getTimestamp() );
|
||||||
$formatted = "<span class='mw-echo-timestamp'>$ts</span> ";
|
$formatted = "<span class='mw-echo-timestamp'>$ts</span> ";
|
||||||
$formatted .= EchoNotificationController::formatNotification( $event, $wgUser, 'html' );
|
$formatted .= EchoNotificationController::formatNotification( $event, $wgUser, 'html' );
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue