Template:Dts
From Wikipedia, the free encyclopedia
Dts stands for Date Table Sorting and is used to correctly sort and display dates in a table when using Help:Sorting.
Contents |
[edit] What it solves
To use Help:Sorting and have it function correctly, dates must be entered in YYYY-MM-DD format. But this 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 and wikilinks the date properly like this July 4, 1776, depending on the user's Special:Preferences.
[edit] Parameters
- 1st parameter - Day
- Day number - 7 or 07
- 2nd parameter - Month
- Full month name - February or february
- Abbreviated month name - Feb or feb
- Month number - 2 or 02
- 3rd parameter - Year
- Year number - any AD year, leading zeros not required
[edit] Input
{{Dts|4|July|1776}}
[edit] Output
Output sent to table
<span style="display:none">1776-07-04</span> [[July 4]] [[1776]]
Output displayed to user
4 July 1776
[edit] Examples
Template syntax | Date rendered |
---|---|
{{dts|4|July|1776}} | 4 July 1776 |
{{dts|9|4|1688}} | 9 April 1688 |
{{dts|09|04|1688}} | 09 April 1688 |
{{dts|11|7|2007}} | 11 July 2007 |
{{dts|4|june|1776}} | 4 June 1776 |
{{dts|11|sep|2001}} | 11 September 2001 |