Page MenuHomePhabricator

Format calendar model in non-HTML output formats if needed
Closed, ResolvedPublic

Description

Currently, this logic exists only in the HtmlTimeFormatter class. We want to apply it to other output formats as well.
However, we want to avoid breaking compatibility for existing users so this should not be done by default.
We will add a new formatter option that controls whether the calendar model is shown or not.

Plain text and wikitext formatters will show the calendar model if needed in parenthesis following the formatted date, as so:

13 March 44 BCE (Gregorian)

Event Timeline

Change 859587 had a related patch set uploaded (by Lucas Werkmeister (WMDE); author: Lucas Werkmeister (WMDE)):

[mediawiki/extensions/Wikibase@master] Introduce new showcalendar option for time formatters

https://gerrit.wikimedia.org/r/859587

Change 859587 merged by jenkins-bot:

[mediawiki/extensions/Wikibase@master] Introduce new showcalendar option for time formatters

https://gerrit.wikimedia.org/r/859587

Seems to work fine on Beta (the added example makes it very easy to test in the API sandbox).

Just to mention it here: the option is called showcalendar, and the valid values are true, false and "auto". (Note that true and false must be booleans, not strings.)

Works on Wikidata now: API request

{
    "result": "14 March 1879 (Gregorian)"
}