This is the template sandbox page for Template:Make YYYY–YY ( diff). |
This template creates a year YYYY–YY range (e.g. 1934–35 or 1984–1989), based on parameters which supply a base year, an optional offset, and an optional span.
This is intended as a helper template for use in constructing other templates. In situations where there is a need to generate a date range with a two-digit ending year, the markup is complicated by the fact that if the ending year ends in 00 (e.g. 1300, 1900, or 2000), then it needs to be written a 4-digits.
For example, a range of one-year span starting in 1999 is written as 1999–2000
, because 1999–00
would be ambiguous.
This template allows year ranges to be generated without a clump of impenetrable code.
Per the Wikipedia Manual of Style (MoS) at MOS:DATERANGE, two-digit ending years are generally deprecated, but are permitted in some limited circumstances. Please check the MoS before using ranges with two-digit ending years.
{{Make YYYY–YY|base year|offset|span}}
All parameters are optional
All parameters are unnamed
2004–05
has a span of 1, while 2004–09
has a span of 5. The default is 1,No parameters
{{Make YYYY–YY}}
→ 2024–2025With base year
{{Make YYYY–YY|1601}}
→ 1601–1602{{Make YYYY–YY|1799}}
→ 1799–00{{Make YYYY–YY|1863}}
→ 1863–1864With base year and offset
{{Make YYYY–YY|1304|5}}
→ 1309–1310{{Make YYYY–YY|1692|1}}
→ 1693–1694{{Make YYYY–YY|2000|-1}}
→ 1999–00With base year and offset and span
{{Make YYYY–YY|2004|5|5}}
→ 2009–2014With base year and span
{{Make YYYY–YY|1979||5}}
→ 1979–1984With span
{{Make YYYY–YY| | |3}}
→ 2024–2027With offset
{{Make YYYY–YY| |-6}}
→ 2018–2019The by-year sub-categories of Category:Australian soccer by year are each parented in two year-range categories.
For example:
The cathead template {{ YYYY in Australian soccer category header}} would need some ugly markup to generate those category names, but with this template, the code is simple:
[[Category:{{Make YYYY–YY|{{Title year}}|-1}} in OFC football|Australia]] [[Category:{{Make YYYY–YY|{{Title year}}}} in OFC football|Australia]]
{{ Make YYYY-YY}}
This is the template sandbox page for Template:Make YYYY–YY ( diff). |
This template creates a year YYYY–YY range (e.g. 1934–35 or 1984–1989), based on parameters which supply a base year, an optional offset, and an optional span.
This is intended as a helper template for use in constructing other templates. In situations where there is a need to generate a date range with a two-digit ending year, the markup is complicated by the fact that if the ending year ends in 00 (e.g. 1300, 1900, or 2000), then it needs to be written a 4-digits.
For example, a range of one-year span starting in 1999 is written as 1999–2000
, because 1999–00
would be ambiguous.
This template allows year ranges to be generated without a clump of impenetrable code.
Per the Wikipedia Manual of Style (MoS) at MOS:DATERANGE, two-digit ending years are generally deprecated, but are permitted in some limited circumstances. Please check the MoS before using ranges with two-digit ending years.
{{Make YYYY–YY|base year|offset|span}}
All parameters are optional
All parameters are unnamed
2004–05
has a span of 1, while 2004–09
has a span of 5. The default is 1,No parameters
{{Make YYYY–YY}}
→ 2024–2025With base year
{{Make YYYY–YY|1601}}
→ 1601–1602{{Make YYYY–YY|1799}}
→ 1799–00{{Make YYYY–YY|1863}}
→ 1863–1864With base year and offset
{{Make YYYY–YY|1304|5}}
→ 1309–1310{{Make YYYY–YY|1692|1}}
→ 1693–1694{{Make YYYY–YY|2000|-1}}
→ 1999–00With base year and offset and span
{{Make YYYY–YY|2004|5|5}}
→ 2009–2014With base year and span
{{Make YYYY–YY|1979||5}}
→ 1979–1984With span
{{Make YYYY–YY| | |3}}
→ 2024–2027With offset
{{Make YYYY–YY| |-6}}
→ 2018–2019The by-year sub-categories of Category:Australian soccer by year are each parented in two year-range categories.
For example:
The cathead template {{ YYYY in Australian soccer category header}} would need some ugly markup to generate those category names, but with this template, the code is simple:
[[Category:{{Make YYYY–YY|{{Title year}}|-1}} in OFC football|Australia]] [[Category:{{Make YYYY–YY|{{Title year}}}} in OFC football|Australia]]
{{ Make YYYY-YY}}