Πρότυπο:Dts
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. This template automatically creates the hidden <span style="display:none">1776-07-04</span>
for sorting purposes and then displays the date like this: July 4, 1776. To hide the output, use the {{dtsh}} template instead.
Parameters Επεξεργασία
Date display can be modified using two named parameters.
|
{{dts|year|month|day|BC}} | {{dts|date}} |
---|---|
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|year|month|day|BC}}
- {{
dts|1776|July|4
}}
{{dts|date}}
- {{
dts|1776-07-04
}} - {{
dts|July 4, 1776
}} - {{
dts|4 July 1776
}}
If one of the latter formats is used there is a limit to the number of occurrences in a page, due to the use of the function #time.
Also see the examples below.
Output Επεξεργασία
Output sent to table
<span style="display:none">01776-07-04</span> July 4, 1776
or<span style="display:none">01776-07-04</span> 4 July 1776
Output displayed to user
- July 4, 1776 or
- 4 July 1776
Linking Επεξεργασία
The template formerly linked dates automatically. To turn linking off the parameter link=off
was used. In accordance with current guidelines linking is no longer supported. Please do not use this parameter. Please remove it from existing transclusions.
Examples Επεξεργασία
Normal function of the template. | The template 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 Επεξεργασία
- {{dtsh}}, hides the template's output
- {{TBA}}, allows quarters, and allows sorting of time periods by end date.
- m:Template:dts (backlinks, edit), since on Meta e.g. 09999 9999 induces numeric sort mode, "&" is prefixed to force string sort mode.
- {{dts1}}
- {{dts vgr}}, for video game release dates.
- {{sort}}, sorting by a specified key
- {{sortname}}, full name sorting.
Η παραπάνω τεκμηρίωση ενσωματώνεται από τη σελίδα Πρότυπο:Dts/τεκμηρίωση. (επεξεργασία | ιστορικό) Οι συντάκτες μπορούν να πειραματίζονται στο πρόχειρο (δημιουργία | αντίγραφο) και στις δοκιμαστικές σελίδες (δημιουργία) του προτύπου. Παρακαλούμε να προσθέτετε τις κατηγορίες στην υποσελίδα τεκμηρίωσης. Υποσελίδες αυτού του προτύπου. |