A value formatter that creates a basic, single-line HTML representation of a TimeValue's date, time and calendar model.
More...
|
| __construct (?FormatterOptions $options, ValueFormatter $dateTimeFormatter) |
|
| format ( $value) |
|
A value formatter that creates a basic, single-line HTML representation of a TimeValue's date, time and calendar model.
The calendar model is added in superscript when needed, either because it's not obvious (e.g. a date in 1800 could be Julian or Gregorian) or because it's different from what the parsers would detect (where 1582 and before is Julian, and 1583 and later is Gregorian).
- See also
- \Wikibase\Lib\Formatters\TimeDetailsFormatter
- Copyright
- GPL-2.0-or-later
- Author
- Adrian Heine adria.nosp@m.n.he.nosp@m.ine@w.nosp@m.ikim.nosp@m.edia..nosp@m.de
-
Thiemo Kreuz
-
Daniel Kinzler
◆ __construct()
Wikibase\Lib\Formatters\HtmlTimeFormatter::__construct |
( |
?FormatterOptions |
$options, |
|
|
ValueFormatter |
$dateTimeFormatter |
|
) |
| |
- Parameters
-
FormatterOptions | null | $options | |
ValueFormatter | $dateTimeFormatter | A value formatter that accepts TimeValue objects and returns the formatted date and time, but not the calendar model. Must return HTML. |
◆ calendarNameNeeded()
Wikibase\Lib\Formatters\HtmlTimeFormatter::calendarNameNeeded |
( |
TimeValue |
$value | ) |
|
|
private |
◆ format()
Wikibase\Lib\Formatters\HtmlTimeFormatter::format |
( |
|
$value | ) |
|
- See also
- ValueFormatter::format
- Parameters
-
- Exceptions
-
- Returns
- string HTML
◆ formatCalendarName()
Wikibase\Lib\Formatters\HtmlTimeFormatter::formatCalendarName |
( |
|
$calendarModel | ) |
|
|
private |
- Parameters
-
- Returns
- string HTML
◆ getDefaultCalendar()
Wikibase\Lib\Formatters\HtmlTimeFormatter::getDefaultCalendar |
( |
|
$year | ) |
|
|
private |
This guesses the most likely calendar model based on the given TimeValue, ignoring the calendar given in the TimeValue.
This should always implement the exact same heuristic as IsoTimestampParser::getCalendarModel().
- See also
- IsoTimestampParser::getCalendarModel()
- Parameters
-
- Returns
- string Calendar URI
◆ $dateTimeFormatter
Wikibase\Lib\Formatters\HtmlTimeFormatter::$dateTimeFormatter |
|
private |
◆ $options
Wikibase\Lib\Formatters\HtmlTimeFormatter::$options |
|
private |
◆ CALENDAR_KEYS
const Wikibase\Lib\Formatters\HtmlTimeFormatter::CALENDAR_KEYS |
|
private |
Initial value:= [
TimeValue::CALENDAR_GREGORIAN => 'wikibase-time-calendar-gregorian',
TimeValue::CALENDAR_JULIAN => 'wikibase-time-calendar-julian',
]
The documentation for this class was generated from the following file: