Template:Make YYYY–YY/doc

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.

Purpose
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, because   would be ambiguous.

This template allows year ranges to be generated without a clump of impenetrable code.

Policy
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.

Usage
All parameters are optional

Parameters
All parameters are unnamed


 * 1) The base year is the year from which the start year is calculated.  If it is omitted, the current year is used.
 * 2) The offset is a number which is added to the base year, to calculate the start year. This useful when the start year is a parameter supplied to the calling template.
 * 3) The span is the length of the range; e.g.   has a span of 1, while   has a span of 5.  The default is 1,

Examples
No parameters

With base year

With base year and offset

With base year and offset and span

With base year and span

With span

With offset

Sample use case
The by-year sub-categories of Category:Australian soccer by year are each parented in two year-range categories.

For example:
 * Category:1995 in Australian soccer is a sub-category of Category:1994–95 in OFC football and Category:1995–96 in OFC football
 * Category:1999 in Australian soccer is a sub-category of Category:1998–99 in OFC football and Category:1999–2000 in OFC football

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:

Redirects
Make YYYY-YY