Template:DateSort: Difference between revisions

From Tardis Wiki, the free Doctor Who reference
No edit summary
(going back to a uniform version of page)
Line 1: Line 1:
<includeonly>{{#switch:{{PAGENAME}}
<includeonly>
{#switch: {{da|{{PAGENAME}}}}
   |  1 January |  1 Jan | Jan 1  | January 1  =  1
   |  1 January |  1 Jan | Jan 1  | January 1  =  1
   |  2 January |  2 Jan | Jan 2  | January 2  =  2
   |  2 January |  2 Jan | Jan 2  | January 2  =  2
Line 152: Line 153:
   | 30 May  | 30 May  | May 30 | May 30 =  150
   | 30 May  | 30 May  | May 30 | May 30 =  150
   | 31 May  | 31 May  | May 31 | May 31 =  151
   | 31 May  | 31 May  | May 31 | May 31 =  151
   |  1 June =  152
   |  1 June |  1 Jun  | Jun 1  | June 1  =  152
   |  2 June =  153
   |  2 June |  2 Jun  | Jun 2  | June 2  =  153
   |  3 June =  154
   |  3 June |  3 Jun  | Jun 3  | June 3  =  154
   |  4 June  |  4 Jun  | Jun 4  | June 4  =  155
   |  4 June  |  4 Jun  | Jun 4  | June 4  =  155
   |  5 June  |  5 Jun  | Jun 5  | June 5  =  156
   |  5 June  |  5 Jun  | Jun 5  | June 5  =  156
Line 365: Line 366:
   | 29 December | 29 Dec | Dec 29 |December 29 = 363
   | 29 December | 29 Dec | Dec 29 |December 29 = 363
   | 30 December | 30 Dec | Dec 30 |December 30 = 364
   | 30 December | 30 Dec | Dec 30 |December 30 = 364
   | 31 December | 31 Dec | Dec 31 |December 31 = 365}}</includeonly><noinclude>{{Documentation}}[[Category:Coding utility templates]]</noinclude>
   | 31 December | 31 Dec | Dec 31 |December 31 = 365
  }}</includeonly><noinclude>{{Documentation}}[[Category:Coding utility templates]]</noinclude>

Revision as of 15:59, 11 June 2013

Instructions for {{DateSort}}
{{DateSort}} — like its sister templates, {{NameSort}} and {{TitleSort}} — allows for apparently automatic sorting of pages. It uses the magic word, DEFAULTSORT, along with a #switch, to convert a day of the year to a number from 1 to 365 (29 February sharing the same number as 28 February), thus allowing day of the year pages to sort numerically.

Usage

Usage is super easy. Just type {{DateSort}} at the bottom of a page. Then, when you add categories to the page you no longer have to define the sort key for every individual category. It will automatically sort the person by their numerical ID.