Wikibase
MediaWiki Wikibase extension
|
A helper class for time value formatters, deciding whether the calendar model should be shown or not. More...
Public Member Functions | |
showCalendarModel (TimeValue $value, FormatterOptions $options) | |
Decide whether the calendar model should be shown or not. | |
Public Attributes | |
const | OPT_SHOW_CALENDAR = 'showcalendar' |
A formatter option that determines whether the calendar model will be shown or not. | |
Private Member Functions | |
calendarNameNeeded (TimeValue $value) | |
getDefaultCalendar (int $year) | |
This guesses the most likely calendar model based on the given TimeValue, ignoring the calendar given in the TimeValue. | |
A helper class for time value formatters, deciding whether the calendar model should be shown or not.
When the 'showcalendar' formatter option is set to 'auto', the calendar model is shown if it's not obvious (e.g. a date in 1800 could be Julian or Gregorian) or if it's different from what the parsers would detect (where 1582 and before is Julian, and 1583 and later is Gregorian).
|
private |
|
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().
int | $year |
Wikibase\Lib\Formatters\ShowCalendarModelDecider::showCalendarModel | ( | TimeValue | $value, |
FormatterOptions | $options ) |
Decide whether the calendar model should be shown or not.
TimeValue | $value | The time value to which the decision applies. |
FormatterOptions | $options | The formatter options. The caller must have set a default for ShowCalendarModelDecider::OPT_SHOW_CALENDAR . |
const Wikibase\Lib\Formatters\ShowCalendarModelDecider::OPT_SHOW_CALENDAR = 'showcalendar' |
A formatter option
that determines whether the calendar model will be shown or not.
If true or false, always show or don’t show the calendar model; if 'auto', show the calendar model if it is needed.