Template:Date sortable/doc
| This is a documentation subpage for Template:Date sortable. It may contain usage information, categories and other content that is not part of the original template page. |
For dates from January 1, 1970 onward only!
(This template was formerly named {{Dts vgr2}}, i.e. Date table sorting for video game release dates)
Usage
Normally, for proper sorting, dates must be entered in YYYY-MM-DD format. But this does not conform to the Manual of Style for date display and wikilinking. Like {{dts}}, this template automatically creates the hidden <span style="display:none">2005-07-04</span> for sorting purposes and then displays and wikilinks the date properly depending on the user's preferences. In accordance with current guidelines, this template does not hotlink dates. Also, if you input only a year and month, then it must be in this format: July 2005.
By default this template outputs dates in "verbose" format. This can be turned off by setting the optional parameter, v, to equal zero, in which case dates are outputted in YYYY-MM-DD format. Setting v to equal 2 forces the "D MONTHNAME YYYY" format.
If for some reason you need to pass a value that is not a valid date (such as "TBD" or "TBA"), or if you do so by accident, the inputted value is returned unchanged.
Don't use this template with dates before 1970, as it relies upon the #time: parser function.
Examples
| Code (v=1, default) | Output | Code (v=0) | Output | Code (v=2) | Output |
|---|---|---|---|---|---|
| {{date sortable|2005}} | 2005 | {{date sortable|v=0|2005}} | 2005 | {{date sortable|v=2|2005}} | 2005 |
| {{date sortable|July 2005}} | July 2005 | {{date sortable|v=0|July 2005}} | 2005-07 | {{date sortable|v=2|July 2005}} | July 2005 |
| {{date sortable|July 4, 2005}} | July 4, 2005 | {{date sortable|v=0|July 4, 2005}} | 2005-07-04 | {{date sortable|v=2|July 4, 2005}} | 4 July 2005 |
| {{date sortable|4 July 2005}} | July 4, 2005 | {{date sortable|v=0|4 July 2005}} | 2005-07-04 | {{date sortable|v=2|4 July 2005}} | 4 July 2005 |
| {{date sortable|2005-07-04}} | July 4, 2005 | {{date sortable|v=0|2005-07-04}} | 2005-07-04 | {{date sortable|v=2|2005-07-04}} | 4 July 2005 |
| {{date sortable|invalid}} | invalid | {{date sortable|v=0|invalid}} | invalid | {{date sortable|v=2|invalid}} | invalid |
| {{date sortable|TBD}} | TBD | {{date sortable|v=0|TBD}} | TBD | {{date sortable|v=2|TBD}} | TBD |
| {{date sortable|TBA}} | TBA | {{date sortable|v=0|TBA}} | TBA | {{date sortable|v=2|TBA}} | TBA |
Related templates
- {{dts}}
Content Disclaimer
Informasi ini disarikan dari Wikipedia dan disajikan kembali untuk tujuan edukasi. Konten tersedia di bawah lisensi CC BY-SA 3.0. Kami tidak bertanggung jawab atas ketidakakuratan data yang bersumber dari kontribusi publik tersebut.
- The information displayed on this website is sourced in part or in whole from Wikipedia and has been adapted for the purpose of restating it. We strive to provide accurate and relevant information, however:
- There is no guarantee of absolute accuracy. Wikipedia is an open, collaborative project that can be edited by anyone, so information is subject to change.
- It is not intended to constitute professional advice. The content displayed is for informational and educational purposes only. For important decisions (e.g., medical, legal, or financial), please consult a professional.
- Content copyright. Wikipedia is licensed under the Creative Commons Attribution-ShareAlike License (CC BY-SA). This means that content may be reused with appropriate attribution and shared under a similar license.
- Responsible use. Any risk arising from the use of information from this website is entirely the responsibility of the user.