MediaWiki REL1_41
MediaWiki\Hook\GetRelativeTimestampHook Interface Reference

This is a hook handler interface, see docs/Hooks.md. More...

Inherited by MediaWiki\HookContainer\HookRunner.

Public Member Functions

 onGetRelativeTimestamp (&$output, &$diff, $timestamp, $relativeTo, $user, $lang)
 Use this hook to pre-emptively override the relative timestamp generated by MWTimestamp::getRelativeTimestamp().
 

Detailed Description

This is a hook handler interface, see docs/Hooks.md.

Use the hook name "GetRelativeTimestamp" to register handlers implementing this interface.

Stability: stable
to implement

Definition at line 17 of file GetRelativeTimestampHook.php.

Member Function Documentation

◆ onGetRelativeTimestamp()

MediaWiki\Hook\GetRelativeTimestampHook::onGetRelativeTimestamp ( & $output,
& $diff,
$timestamp,
$relativeTo,
$user,
$lang )

Use this hook to pre-emptively override the relative timestamp generated by MWTimestamp::getRelativeTimestamp().

Since
1.35
Parameters
string&$outputString for the output timestamp
DateInterval&$diffDifference between the timestamps
MWTimestamp$timestampCurrent (user-adjusted) timestamp
MWTimestamp$relativeToRelative (user-adjusted) timestamp
User$userUser whose preferences are being used to make timestamp
Language$langLanguage that will be used to render the timestamp
Returns
bool|void True or no return value to continue, or false to use the custom output

Implemented in MediaWiki\HookContainer\HookRunner.


The documentation for this interface was generated from the following file: