Modul ini dilindungi. Modul ini sangat mencolok yang digunakan oleh banyak halaman, atau sangat sering disubstitusikan. Karena vandalisme atau kesalahan akan mempengaruhi banyak halaman, dan suntingan kecil dapat memberi beban besar pada server, modul ini dilindungi dari penyuntingan.
Modul Lua ini digunakan pada sekitar3.300 halaman dan perubahannya kemungkinan memicu perubahan massal pada semua halaman yang menggunakannya. Uji cobalah di subhalaman /bak pasir atau /kasus uji Modul:Age, atau bak pasir modul Anda. Pertimbangkan untuk mendiskusikan perubahan di halaman pembicaraan sebelum mengimplementasikannya.
The age templates expect the older date to be first. The implementations of age_in_years and age_in_years_nts display an error message if that is not the case. If similar checking is wanted for other templates, negative=error can be added to the invoke. For example, {{age}} might use:
A value of 1,000 or more is displayed with commas.
format=raw
Numbers are displayed without commas and negative numbers are displayed with a hyphen for {{#expr}}. In addition, {{age}} outputs a plain number and will not include a span to indicate if the result relies on the current date.
format=cardinal
Display the resulting number using words such as "five" instead of 5. See below.
format=ordinal
Display the resulting number using words such as "fifth" instead of 5. See below.
range=dash
Accept a year only, or a year and month only, and show a range of ages with an en dash (–).
range=yes
Accept a year or year/month, and show the range with "or".
range=no
Accept a year only, or year/month, but show only a single age as if full dates had been entered.
round=on
The age is rounded to the nearest least-significant time unit.
sc=on
A serial comma is used (only useful when three or more values are displayed).
sc=yes
Same as sc=on.
show=hide
The age is not displayed; may be useful with sortable=on.
sortable=on
Insert a hidden sort key before the result (for use in sortable tables).
sortable=table
Insert a sort key using table syntax data-sort-value="value"|.
sortable=debug
Same as sortable=on but the sort key is displayed for testing.
sortable=off
No sort key (can override the default for a template like {{age nts}}).
Examples using the range parameter follow.
{{age in years and months|year=2001|month=1|year2=2012|month2=2|range=yes}} → 11tahun, 0atau 1bulan
{{age in years and months|2001|1||2012|2|range=yes}} → 11tahun, 0atau 1bulan
{{age in years and months|Jan 2001|Feb 2012|range=yes}} → 11tahun, 0atau 1bulan
{{age in years and months|Jan 2001|Feb 2012|range=dash}} → 11tahun, 0–1bulan
{{age in years and months|Jan 2001|Feb 2012|range=no}} → 11tahun, 1bulan(assume 1 Jan 2001 to 1 Feb 2012)
{{age in years and months|12 Jan 2001|Feb 2012|range=no}} → 11tahun, 1bulan(assume 12 Jan 2001 to 12 Feb 2012)
{{age in years and months|2001|2012|range=no}} → 11tahun(assume 1 Jan 2001 to 1 Jan 2012)
{{age in years and months|2001|23 Feb 2012|range=no}} → 11tahun(assume 23 Feb 2001 to 23 Feb 2012)
The sort key is based on the age in days, and fractions of a day if a time is specified.
{{age in years and months|10 Jan 2001|20 Feb 2012|sortable=debug}} → 7003405800000000000♠11tahun, 1bulan
{{age in years and months|10 Jan 2001|6:00 am 20 Feb 2012|sortable=debug}} → 7003405825000000000♠11tahun, 1bulan
{{age in years and months|10 Jan 2001|6:00 am 20 Feb 2012|sortable=debug|show=hide}} → 7003405825000000000♠
An extra day is added for a duration.
{{age in years and months|20 Jan 2001|19 Feb 2012}} → 11tahun(one day short of 11 years, 1 month)
{{age in years and months|20 Jan 2001|19 Feb 2012|duration=on}} → 11tahun, 1bulan
The least-significant time unit can be rounded.
{{age in years and months|20 Jan 2001|10 Feb 2012}} → 11tahun
{{age in years and months|20 Jan 2001|10 Feb 2012|round=on}} → 11tahun, 1bulan(round to nearest month)
Large numbers can be formatted with commas.
{{age in years and months|120|2012|format=commas|range=yes}} → 1,891atau 1,892tahun
{{age in years and months|120|2012|format=commas|range=dash}} → 1,891–1,892tahun
Spelling numbers
The templates that use age_generic can display numbers in words rather than using numerals. The result can be a cardinal number (such as "five") or an ordinal number (such as "fifth"). The first letter can be in uppercase, and US spelling of numbers can be used. Examples: