User additions to AugsburgWrestling.info are currently disabled due to repeated vandalism.
Please contact us to create an account and start editing.
Template:Dts
Template:Template doc page transcluded Dts stands for Date Table Sorting and is used to correctly sort and display dates in a sortable table (see Help:Sorting).
What it solves
Normally, for proper sorting, dates must be entered in YYYY-MM-DD format. However, that format does not conform to the Manual of Style for date display and wikilinking.
This template automatically creates the hidden <span style="display:none">1776-07-04</span>
for sorting purposes and then displays the date like this:
- plain text July 4, 1776 (default, link=off)
- wikilinked July 4 1776, format depends on the user's Special:Preferences (if link=on is specified)
Parameters
- 1st parameter - Year (optional if month is given)
- Year number - number in the range -9999 through 9999: the numbers -9999 through 0 are used without "bc" and represent astronomical years -9999 through 0, the numbers 1 through 9999 represent that year AD, or BC with the fourth parameter set to bc or BC
- 2nd parameter - Month (optional if the day is not given either)
- Full month name - February or february
- Abbreviated month name - Feb or feb
- Month number - 2 or 02
- 3rd parameter - Day (optional)
- Day number - 7 or 07
- 4th parameter - optional with value BC or bc
- Used with a positive year number
Thus e.g. for the year 5 BC we can use "5|bc" or "-4".
A time period (year or month and year) is sorted according to its start, and time periods with the same starting moment are in order of descending length: a year comes before its first month; a month comes before its first day.
Input
{{Dts|1776|July|4}}
See also the examples.
Output
Output sent to table
<span style="display:none">1776-07-04</span> July 4 1776
Output displayed to user
Template:MONTHNAME 4, 1776
Examples
The same examples as above, but with debug=yes
, which causes hidden parts to appear:
Error handling
During early 2009, Template:Dts generated month names for invalid month numbers, such as number 23 displaying "November". No warning is displayed, for the formatted page, that such invalid dates are being used on the page.
See also
- Template:Tiw - allows quarters, and allows sorting of time periods by end date.
- Template:Tim - since on Meta e.g. 09999 9999 induces numeric sort mode, "&" is prefixed to force string sort mode.
- Template:Tiw
- Template:Tiw
- Template:Tiw - for video game release dates.
The above documentation is transcluded from Template:Dts/doc. (edit | history) Editors can experiment in this template's sandbox (create |mirror) and testcases (create) pages. Please add categories to the /doc subpage. Subpages of this template. |