Jump to content
Wikipedia The Free Encyclopedia

Module:Person date/doc

From Wikipedia, the free encyclopedia
icon This is a documentation subpage for Module:Person date.
It may contain usage information, categories and other content that is not part of the original module page.
This module is rated as ready for general use. It has reached a mature state, is considered relatively stable and bug-free, and may be used wherever appropriate. It can be mentioned on help pages and other Wikipedia resources as an option for new users. To minimise server load and avoid disruptive output, improvements should be developed through sandbox testing rather than repeated trial-and-error editing.
Warning This Lua module is used on approximately 1,720,000 pages, or roughly 3% 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 }} and other People and person infobox templates.

This module generates errors when it encounters invalid input. Error descriptions and how to fix them are listed at Category:Pages using age template with invalid date.

Usage

[edit ]
  • {{#invoke:person date|birth}}
  • {{#invoke:person date|death}}

In infoboxes

[edit ]
{{Infobox
...
| label# = Born
| data# = {{#invoke:person date|birth}}
| label# = Died
| data# = {{#invoke:person date|death}}
...
}}

Or

{{Infobox
...
| label# = Born
| data# = {{br separated entries
 |1={{#if:{{{birth_name|}}}|<divstyle="display:inline"class="nickname">{{{birth_name|}}}</div>}}
 |2={{#invoke:person date|birth}}
 |3={{#if:{{{birth_place|}}}|<divclass="birthplace">{{{birth_place|}}}</div>}}
}}
| label# = Died
| data# = {{br separated entries
 |1={{#invoke:person date|death}}
 |2={{#if:{{{death_place|}}}|<divclass="deathplace">{{{death_place|}}}</div>}}
}}
...
}}

Areas for improvement

[edit ]
  1. 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.
  2. If |birth_date={{bda|1993|11|7}} (for example) then |death_date= will not be parsed. It will just be returned as the original string. Thus no age is calculated.

Tracking categories

[edit ]

AltStyle によって変換されたページ (->オリジナル) /