Difference between revisions of "Template:Daterangedash/doc"

From blackwiki
Jump to navigation Jump to search
imported>Howcheng
(Created page with '{{Documentation subpage}} <!-- Please place categories where indicated at the bottom of this page and interwikis at Wikidata (see Wikipedia:Wikidata) --> Thi...')
 
imported>Howcheng
(see also)
Line 44: Line 44:
 
|-
 
|-
 
|}
 
|}
 +
 +
==See also==
 +
* {{tl|daterange}}
 
<includeonly>
 
<includeonly>
 
<!-- Categories below this line, please; interwikis at Wikidata -->
 
<!-- Categories below this line, please; interwikis at Wikidata -->
 
[[Category:Time, date and calendar templates]]
 
[[Category:Time, date and calendar templates]]
 
</includeonly>
 
</includeonly>

Revision as of 22:32, 19 September 2017

This template creates a date range with non-breaking spaces between the month and day, and {{spaced ndash}}.

Usage

{{daterangedash|Starting date|Ending date|Date format string}}

Both date values can be in any format accepted by PHP's strtotime() function.

  • Starting date is the starting date for the range.
  • Ending Date is the ending date for the range.
  • Date format string is one of the following:
    • dm: day month (1 January)
    • dmy: day month year (1 January 1900)
    • md: month day (January 1)
    • mdy: month day year (January 1, 1900) – note: a comma will be inserted

If both start and end dates are in the same year, the first year will be omitted.

Examples

Description Template code Wikicode equivalent Rendered output
Date and month only {{daterangedash|2012-01-10|2012-02-28|dm}} {{nowrap|10 January}}{{spaced ndash}}{{nowrap|28 February}} 10 JanuaryTemplate:Spaced ndash28 February
Date month year {{daterangedash|January 1 1999|August 5|dmy}} {{nowrap|1 January}} 1999{{spaced ndash}}{{nowrap|5 August}} 2025 1 JanuaryTemplate:Sp 1999Template:Spaced ndash5 AugustTemplate:Sp 2025
Month day only {{daterangedash|September 11|September 15|md}} {{nowrap|September 11}}{{spaced ndash}}{{nowrap|September 15}} September 11Template:Spaced ndashSeptember 15
Month day year, both dates in same year {{daterangedash|April 20 2015|May 14 2015|dmy}} {{nowrap|April 20}}{{spaced ndash}}{{nowrap|May 14}} 2015 April 20Template:Spaced ndashMay 14, 2015

See also