Module:Person date/doc
Ọdịdị
This is the documentation page for Module:Person date
| This module is rated as ready for general use. It has reached a mature form and is thought to be bug-free and ready for use wherever appropriate. It is ready to mention on help pages and other Wikipedia resources as an option for new users to learn. To reduce server load and bad output, it should be improved by sandbox testing rather than repeated trial-and-error editing. |
| This Lua module is used on approximately 1,100,000 pages, or roughly 1813% of all pages. To avoid major disruption and server load, any changes should be tested in the module's /sandbox or /testcases subpages, or in your own module sandbox. The tested changes can be added to this page in a single edit. Consider discussing changes on the talk page before implementing them. |
This module is intended to aid in calculating/formatting birth dates and death dates in {{Infobox person}}. It is implemented by {{Infobox person/birth}} & {{Infobox person/death}}.
Usage
[dezie ebe o si]{{#invoke:person date|birth|birth_date|death_date}}{{#invoke:person date|death|birth_date|death_date}}
In infoboxes
[dezie ebe o si]{{Infobox
...
| label# = Born
| data# = {{#if: {{{birth_date|}}} | {{Infobox person/birth|{{{birth_date|}}}|{{{death_date|}}} }} }}
| label# = Died
| data# = {{#if: {{{death_date|}}} | {{Infobox person/death|{{{birth_date|}}}|{{{death_date|}}} }} }}
...
}}
Or
{{Infobox
...
| label# = Born
| data# = {{br separated entries
|1={{#if:{{{birth_name|}}}|<div style="display:inline" class="nickname">{{{birth_name|}}}</div>}}
|2={{#if:{{{birth_date|}}} | {{Infobox person/birth|{{{birth_date|}}}|{{{death_date|}}} }} }}
|3={{#if:{{{birth_place|}}}|<div class="birthplace">{{{birth_place|}}}</div>}}
}}
| label# = Died
| data# = {{br separated entries
|1={{#if:{{{death_date|}}} | {{Infobox person/death|{{{birth_date|}}}|{{{death_date}}} }} }}
|2={{#if:{{{death_place|}}}|<div class="deathplace">{{{death_place|}}}</div>}}
}}
...
}}
Areas for improvement
[dezie ebe o si]- Currently the module does not handle anything that is not a simple date. So anything with a reference tag is not evaluated by the code.
- If
|birth_date=(for example) then{{bda|1993|11|7}}|death_date=will not be parsed. It will just be returned as the original string. Thus no age is calculated.- Example:
{{person date/death|→ 12 December 2020{{bda|1993|11|7}}|12 December 2020}}
- Example: