Wikibase
MediaWiki Wikibase extension
Loading...
Searching...
No Matches
Wikibase\Lib\Formatters\TimeDetailsFormatter Class Reference

Formatter for rendering the details of a TimeValue (most useful for diffs) in HTML. More...

+ Inheritance diagram for Wikibase\Lib\Formatters\TimeDetailsFormatter:
+ Collaboration diagram for Wikibase\Lib\Formatters\TimeDetailsFormatter:

Public Member Functions

 __construct (?FormatterOptions $options, ValueFormatter $timeFormatter)
 
 format ( $value)
 

Private Member Functions

 getTimestampHtml ( $timestamp)
 
 getTimeZoneHtml ( $timezone)
 
 getCalendarModelHtml ( $calendarModel)
 
 getAmountAndPrecisionHtml ( $precision, $amount=1)
 
 getFieldHtml ( $fieldName, $valueHtml)
 
 msg ( $key)
 

Private Attributes

 $timeFormatter
 
 $options
 

Detailed Description

Formatter for rendering the details of a TimeValue (most useful for diffs) in HTML.

See also
\Wikibase\Lib\Formatters\HtmlTimeFormatter
Author
Daniel Kinzler
Thiemo Kreuz

Constructor & Destructor Documentation

◆ __construct()

Wikibase\Lib\Formatters\TimeDetailsFormatter::__construct ( ?FormatterOptions  $options,
ValueFormatter  $timeFormatter 
)
Parameters
FormatterOptions | null$options
ValueFormatter$timeFormatterA TimeValue formatter that outputs a single line of HTML, suitable for headings.

Member Function Documentation

◆ format()

Wikibase\Lib\Formatters\TimeDetailsFormatter::format (   $value)
See also
ValueFormatter::format

Generates HTML representing the details of a TimeValue, as an itemized list.

Parameters
TimeValue$value
Exceptions
InvalidArgumentException
Returns
string HTML

◆ getAmountAndPrecisionHtml()

Wikibase\Lib\Formatters\TimeDetailsFormatter::getAmountAndPrecisionHtml (   $precision,
  $amount = 1 
)
private
Parameters
int$precisionOne of the TimeValue::PRECISION_... constants.
int$amount
Returns
string HTML

◆ getCalendarModelHtml()

Wikibase\Lib\Formatters\TimeDetailsFormatter::getCalendarModelHtml (   $calendarModel)
private
Parameters
string$calendarModelURI
Returns
string HTML

◆ getFieldHtml()

Wikibase\Lib\Formatters\TimeDetailsFormatter::getFieldHtml (   $fieldName,
  $valueHtml 
)
private
Parameters
string$fieldName
string$valueHtml
Returns
string HTML

◆ getTimestampHtml()

Wikibase\Lib\Formatters\TimeDetailsFormatter::getTimestampHtml (   $timestamp)
private
Parameters
string$timestamp
Returns
string HTML

◆ getTimeZoneHtml()

Wikibase\Lib\Formatters\TimeDetailsFormatter::getTimeZoneHtml (   $timezone)
private
Parameters
int$timezonein minutes
Returns
string HTML

◆ msg()

Wikibase\Lib\Formatters\TimeDetailsFormatter::msg (   $key)
private
Parameters
string$key
Returns
string

Member Data Documentation

◆ $options

Wikibase\Lib\Formatters\TimeDetailsFormatter::$options
private

◆ $timeFormatter

Wikibase\Lib\Formatters\TimeDetailsFormatter::$timeFormatter
private

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