Jump to content

Module:Daterange/doc

From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by Ahecht (talk | contribs) at 01:59, 24 February 2023 (code is a little more forgiving now). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.

Used for formatting ranges of dates. Can accept an unlimited number of start/end pairs. It will automatically truncate the end date to the last two digits if the rest of the digits match. If the end date is missing, the range will be presented with just the start date (or you can set the end date to "present").

Usage

{{#invoke:Daterange|main|1997|2002}} → 1997–2002

{{#invoke:Daterange|main|start=2020|end=2002}} → 2020–22

{{#invoke:Daterange|main|start1=1997|end1=2002|start2=2020|end2=2022|start3=2023}} → 1997–2002, 2020–22, 2023

The module will not handle non-sequential parameters, so if you have {{{start1}}}, {{{start2}}}, and {{{start4}}}, only {{{start1}}} and {{{start2}}} will be used.


See Also