Template:En dash range/doc
Jump to navigation
Jump to search
File:OOjs UI icon book-ltr.svg | This is a documentation subpage for Template:En dash range. It contains usage information, categories and other content that is not part of the original Template page. |
[[Category:Template documentation pages{{#translation:}}]]
File:Lua-logo-nolabel.svg | Uses Lua: |
This template creates a en dash-separated range that is compliant with MOS:RANGE. Its main purpose is to automatically determine whether a spaced or unspaced dash is to be used, based on the presence of whitespace, hyphens, or dashes in either term.
Usage
{{En dash range|start|end}}
Examples:
{{En dash range|2020|2021}}
: 2020–2021{{En dash range|1 January 2020|1 January 2021}}
: 1 January 2020 – 1 January 2021{{En dash range|1 January 2020|2021}}
: 1 January 2020 – 2021{{En dash range|2020|1 January 2021}}
: 2020 – 1 January 2021{{En dash range|2020-01-01|2021-01-01}}
: 2020-01-01 – 2021-01-01{{En dash range|2020|2021<ref>...</ref>}}
: 2020–2021[1]