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)"
}
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy