Andoza:Birth-date and age
Bu andozadan taxminan 11 000 sahifada foydalanilgan. Tajriba oʻtkazish uchun andozaning /qumloq yoki /test ostsahifalaridan foydalaning. Oʻzgarishlar kiritishdan avval boshqa foydalanuvchilar bilan muhokama qilish haqida oʻylab koʻring. |
This template tracks the Wikidata property: |
Bu andoza quyidagi Luadan foydalanadi: |
{{Birth-date and age}} displays a person’s birth date and age. Besides calculating the age of the person, the benefit of using this template is to allow for the inclusion of hidden microformat dates, which may be indexed or searched by software tools.
Note: The template may not calculate the age correctly if a full date (month, day, year) is not provided. For example, a person who was born in 1941 could be either 82 or 83, depending on whether they have reached their birthday in the current year:
{{Birth-date and age|1941}}
→ 1941 (yoshi 83){{Birth-date and age|dekabr 1941}}
→ Not recognized as a date. Years must have 4 digits (use leading zeros for years < 1000). (yoshi Expression error: Unexpected < operator.)
When only the year is known, consider using {{Birth year and age}} instead:
{{Birth year and age|1941}}
→ 1941 (yoshi 82–83){{Birth year and age|1941|12}}
→ dekabr 1941 (yoshi 82–83)
Usage
- Format
{{Birth-date and age| birth date }}
{{Birth-date and age| birth date | wikitext to display in place of 'birth date'. Like the right hand parameter in a wikilink, this could be alternate text, links, templates etc. }}
hCard microformat
This template also returns the date, hidden by CSS, in the ISO 8601 standard.[1] [2] For example:
(<span class="bday">1993-02-24</span>)
Note: For the "foundation", "built" and similar set-up dates of companies, buildings etc., use {{start date}} (this will work for year-only or month-year dates). Because the ISO 8601 standard requires the Gregorian calendar, this template should not be used if the date is given in the Julian calendar.
For further information, visit the microformats project.
Examples
Month first format: Sample below displays April 12, 1941, with invisible microformat date: 1941-04-12
(yoshi 83)
|
Day first format: Sample below displays 12 April 1941, with invisible microformat date: 1941-04-12
(yoshi 83)
|
Year only, year and month only: Sample below displays 1941, with invisible microformat date: 1941
(yoshi 83)
|
Demo of ISO date, as well as alternate displays. Sample below displays Twelfth of April, 1941, with invisible microformat date: 1941-04-12
(yoshi 83)
|
Microformat output
Birth date and age templates: Lua xatosi in package.lua at line 80: module 'Module:Template test case/data' not found. Lua xatosi in package.lua at line 80: module 'Module:Template test case/data' not found.
Parameters
{{birth-date and age|birth date|additional parameters}}
Parameter | Default | ||
---|---|---|---|
(required) | 1 | Birth date. May be year only, year and month, year month and day, expressed in natural formats: e.g.: 24 August 1953, 1955-08-25, Sunday, December 7, 1941. If parameter three is not specified, the birth date is displayed in exactly this format. This value as well as parameter 2 may not include links. If links or templates that do not evaluate as recognizable dates are desired, use parameter 2. | – |
(optional) | 2 | The birth date to display. This may include links or templates, or any combination of them, and overrides parameter 1. | parm 1 |
(optional) | bce | If birth date is BC, set to "b". | – |
(optional) | gregorian | If Julian date is used, this parameter is required. The date provided is used for emitting the correct microformat translation of the birth date. | parm 1 |
(optional) | dt | This value if present is the ISO8601 value emitted to indicate microformat birth date. It overrides any calculated value. | – |
Supporting templates
Alternative template
- Template:Birth date and age (The name of the alternative template does not have a hyphen after "Birth".)
Tracking categories
- Category:Birth-date and age transclusions with invalid parameters (1)
- Category:Date of birth not in Wikidata (0) – added by Template:Birth-date
- Category:Articles without Wikidata item (0) – added by Template:Birth-date and other templates
See also
Yuqoridagi hujjat Andoza:Birth-date and age/doc sahifasidan olingan. Tajriba oʻtkazish uchun qumloq va test sahifasidan foydalaning. Iltimos, turkumlarni hujjat sahifasiga va intervikilarni vikimaʼlumotlarga joylashtiring. Ushbu andoza ostsahifalari. |
- ↑ „Date Design Pattern“. Microformats Wiki (2013-yil 7-aprel).
- ↑ „hCalendar closed issues“. Microformats Wiki (2009-yil 28-avgust). Specifically rejects supporting the Julian calendar.