Module:Date table sorting/doc
Appearance
| This is a documentation subpage for Module:Date table sorting. It contains usage information, categories, and other content that is not part of the original module page. |
Usage
[edit]Generates a <time data-sort-value=[standardized-date] datetime=[standardized-date]>[formatted date]</time> tag, where [standardized-date] is in ISO 8601 format (e.g. 2020-07-25), and [formatted date] is in a customizable format.
- From a content page, you should use {{Date table sorting}}.
- From a template, you should invoke
mainfunction{{#invoke|main}} - From a module, you should call
_mainfunctionrequire('Module:Date table sorting')._main
Arguments can be passed through either template call or Module invokation.
Arguments
[edit]- lang
- Code of the language in which you want to display the date. In most cases, it should be
{{PAGELANGUAGE}}(from a Lua module, you can get it withframe:preprocess( '{{PAGELANGUAGE}}' )). - format
- Deprecated (kept for backware compatibility). Use phpformat instead.
- phpformat
- Date display format: any string supported by
{{#time}}(you can read its documentation page). Defaults to "j xg Y" (e.g. “6 January 2020”). - precision
- Instead of setting a phpformat, the module can guess it from date precision integer:
9will display only year,10will display month and year, and11will display day, month and year. These values come from Wikidata date data model. - date
- full date (takes precedence over other date arguments)
- year
- year (takes precedence over numbered date arguments)
- month
- month (works only if year is set)
- day
- day (works only if both year and month are set)
- 1
- full date or year
- 2
- month (works only if 1 is set)
- 3
- day (works only if both 1 and 2 are set)