<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://irony.wiki/index.php?action=history&amp;feed=atom&amp;title=Template%3ADate_table_sort%2Fdoc</id>
	<title>Template:Date table sort/doc - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://irony.wiki/index.php?action=history&amp;feed=atom&amp;title=Template%3ADate_table_sort%2Fdoc"/>
	<link rel="alternate" type="text/html" href="https://irony.wiki/index.php?title=Template:Date_table_sort/doc&amp;action=history"/>
	<updated>2026-04-06T22:13:13Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.44.5</generator>
	<entry>
		<id>https://irony.wiki/index.php?title=Template:Date_table_sort/doc&amp;diff=1443&amp;oldid=prev</id>
		<title>Saucy: doc</title>
		<link rel="alternate" type="text/html" href="https://irony.wiki/index.php?title=Template:Date_table_sort/doc&amp;diff=1443&amp;oldid=prev"/>
		<updated>2021-02-01T03:06:13Z</updated>

		<summary type="html">&lt;p&gt;doc&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;&amp;#039;&amp;#039;&amp;#039;Date table sorting&amp;#039;&amp;#039;&amp;#039; is used to correctly sort and display dates in a sortable table.&lt;br /&gt;
&lt;br /&gt;
Template [[wp:Template:Date table sorting|copied from Wikipedia]]. Additional documentation is available there.&lt;br /&gt;
&lt;br /&gt;
==What it solves==&lt;br /&gt;
Dates in their customary formats, if simply treated as alphanumeric text strings, sort in nonsensical ways:&lt;br /&gt;
*1 September 1998 sorts alphanumerically before 5 March 1967, because &amp;#039;&amp;#039;1&amp;#039;&amp;#039; is less than &amp;#039;&amp;#039;5&amp;#039;&amp;#039;;&lt;br /&gt;
*February 5, 1922 sorts alphanumerically before January 3, 1922, because &amp;#039;&amp;#039;F&amp;#039;&amp;#039; comes before &amp;#039;&amp;#039;J&amp;#039;&amp;#039;.&lt;br /&gt;
Use of the YYYY-MM-DD format would solve this problem, but with minor exceptions that format is not used in articles.&lt;br /&gt;
&lt;br /&gt;
This template automatically attaches a &amp;quot;hidden key&amp;quot; to dates, causing them to sort correctly while still being displayed in one of the customary display formats such as &amp;#039;&amp;#039;February 5, 1922&amp;#039;&amp;#039; or &amp;#039;&amp;#039;5 Feb 1922&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
==Parameters==&lt;br /&gt;
===Dates===&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
|-&lt;br /&gt;
|+The year, month and day can either be entered separately or as a single date.&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot; |&amp;amp;#123;&amp;amp;#123;Date table sort&amp;amp;#124;&amp;#039;&amp;#039;year&amp;#039;&amp;#039;&amp;amp;#124;&amp;#039;&amp;#039;month&amp;#039;&amp;#039;&amp;amp;#124;&amp;#039;&amp;#039;day&amp;#039;&amp;#039;&amp;amp;#124;&amp;#039;&amp;#039;BC&amp;#039;&amp;#039;&amp;amp;#125;&amp;amp;#125;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot; |&amp;amp;#123;&amp;amp;#123;Date table sort&amp;amp;#124;&amp;#039;&amp;#039;date&amp;#039;&amp;#039;&amp;amp;#125;&amp;amp;#125;&lt;br /&gt;
|- style=&amp;quot;vertical-align:top;&amp;quot;&lt;br /&gt;
|&lt;br /&gt;
* 1st parameter – Year (optional if month is given)&lt;br /&gt;
** Positive number (1 to 999,999,999,999) represent years AD or BC (dependant on the fourth parameter).&lt;br /&gt;
** Negative numbers (−1 to −999,999,999,999) represent years BC (without the fourth parameter).&lt;br /&gt;
** Year numbers must not contain commas or other formatting.&lt;br /&gt;
* 2nd parameter – Month (optional if the day is not given either)&lt;br /&gt;
** Full month name – e.g. February&lt;br /&gt;
** Abbreviated month name – e.g. Feb&lt;br /&gt;
** Month number – (either zero-padded or not) e.g. 2 or 02&lt;br /&gt;
* 3rd parameter – Day (optional)&lt;br /&gt;
** Day number – (either zero-padded or not) e.g. 7 or 07&lt;br /&gt;
* 4th parameter – (optional)&lt;br /&gt;
** May be BC, AD, BCE or CE&lt;br /&gt;
** Used with a positive year number&lt;br /&gt;
|&lt;br /&gt;
* 1st parameter – the full date&lt;br /&gt;
** By default YYYY-MM-DD format becomes month-day-year format and DD-MM-YYYY format becomes day-month-year while other formats remain in the order they are input.&lt;br /&gt;
** Abbreviated months are accepted and are abbreviated in the output.&lt;br /&gt;
** Capitalisation and comma mistakes are corrected.&lt;br /&gt;
** A single number is interpreted as a year, otherwise the date is parsed by the module. The following formats are accepted:&lt;br /&gt;
*** YYYY-MM-DD&lt;br /&gt;
*** DD-MM-YYYY&lt;br /&gt;
*** DD Month YYYY&lt;br /&gt;
*** Month DD, YYYY&lt;br /&gt;
*** YYYY-MM&lt;br /&gt;
*** DD Month&lt;br /&gt;
*** Month DD&lt;br /&gt;
*** Month YYYY&lt;br /&gt;
*** YYYY&lt;br /&gt;
*** Month&lt;br /&gt;
** Day and month numbers may be 1 or 2 digits, and year numbers may only be 3 or 4 digits. If you need to input a number less than 1000, use leading zeroes (e.g. &amp;quot;0700&amp;quot;).&lt;br /&gt;
** BC years can only be parsed if the date is only the year number.&lt;br /&gt;
** If you need to include the day or month for BC years or years greater than 9999, you must use separate parameters for year, month and day.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==TemplateData==&lt;br /&gt;
&amp;lt;templatedata&amp;gt;&lt;br /&gt;
{&lt;br /&gt;
	&amp;quot;params&amp;quot;: {&lt;br /&gt;
		&amp;quot;1&amp;quot;: {&lt;br /&gt;
			&amp;quot;label&amp;quot;: &amp;quot;Full date or year&amp;quot;,&lt;br /&gt;
			&amp;quot;description&amp;quot;: &amp;quot;Full date if second to fourth parameters are not specfied, otherwise year. Full date can be either in \&amp;quot;YYYY-MM-DD\&amp;quot;, \&amp;quot;DD-MM-YYYY\&amp;quot;, \&amp;quot;DD Month YYYY\&amp;quot;, \&amp;quot;Month DD, YYYY\&amp;quot;, \&amp;quot;YYYY-MM\&amp;quot;, \&amp;quot;DD Month\&amp;quot;, \&amp;quot;Month DD\&amp;quot;, \&amp;quot;Month YYYY\&amp;quot; or \&amp;quot;Month\&amp;quot; format. Year is either a positive number or a negative number. If fourth parameter is not specified negative numbers are interpreted as years of BC era. Parameter is optional if the second parameter is specified.&amp;quot;,&lt;br /&gt;
			&amp;quot;example&amp;quot;: &amp;quot;\&amp;quot;1893\&amp;quot;, \&amp;quot;-89\&amp;quot;, \&amp;quot;-10000\&amp;quot;, \&amp;quot;Oct\&amp;quot;, \&amp;quot;February 1767\&amp;quot;, \&amp;quot;12 Aug 1987\&amp;quot;, \&amp;quot;July 1, 1867\&amp;quot;, \&amp;quot;25 October\&amp;quot;, \&amp;quot;Jan 1\&amp;quot;, \&amp;quot;2014-12-09\&amp;quot;&amp;quot;,&lt;br /&gt;
			&amp;quot;type&amp;quot;: &amp;quot;string&amp;quot;&lt;br /&gt;
		},&lt;br /&gt;
		&amp;quot;2&amp;quot;: {&lt;br /&gt;
			&amp;quot;label&amp;quot;: &amp;quot;Month&amp;quot;,&lt;br /&gt;
			&amp;quot;description&amp;quot;: &amp;quot;Full or abbreviated month name or alternatively, a month number which can be zero-padded. Parameter is optional if the third parameter is not specified.&amp;quot;,&lt;br /&gt;
			&amp;quot;example&amp;quot;: &amp;quot;February, Feb, 2 or 02&amp;quot;,&lt;br /&gt;
			&amp;quot;type&amp;quot;: &amp;quot;string&amp;quot;&lt;br /&gt;
		},&lt;br /&gt;
		&amp;quot;3&amp;quot;: {&lt;br /&gt;
			&amp;quot;label&amp;quot;: &amp;quot;Day&amp;quot;,&lt;br /&gt;
			&amp;quot;description&amp;quot;: &amp;quot;Day, optionally zero-padded&amp;quot;,&lt;br /&gt;
			&amp;quot;example&amp;quot;: &amp;quot;7 or 07&amp;quot;,&lt;br /&gt;
			&amp;quot;type&amp;quot;: &amp;quot;number&amp;quot;&lt;br /&gt;
		},&lt;br /&gt;
		&amp;quot;4&amp;quot;: {&lt;br /&gt;
			&amp;quot;label&amp;quot;: &amp;quot;Era&amp;quot;,&lt;br /&gt;
			&amp;quot;description&amp;quot;: &amp;quot;BC, AD, BCE or CE. Takes effect only if the first parameter is a positive number.&amp;quot;,&lt;br /&gt;
			&amp;quot;type&amp;quot;: &amp;quot;string&amp;quot;&lt;br /&gt;
		},&lt;br /&gt;
		&amp;quot;format&amp;quot;: {&lt;br /&gt;
			&amp;quot;label&amp;quot;: &amp;quot;Format&amp;quot;,&lt;br /&gt;
			&amp;quot;description&amp;quot;: &amp;quot;Controls the output format. Can be \&amp;quot;dmy\&amp;quot;, \&amp;quot;dm\&amp;quot;, \&amp;quot;mdy\&amp;quot;, \&amp;quot;md\&amp;quot;, \&amp;quot;my\&amp;quot;, \&amp;quot;d\&amp;quot;, \&amp;quot;m\&amp;quot;, \&amp;quot;y\&amp;quot; or \&amp;quot;hide\&amp;quot;.&amp;quot;,&lt;br /&gt;
			&amp;quot;type&amp;quot;: &amp;quot;string&amp;quot;&lt;br /&gt;
		},&lt;br /&gt;
		&amp;quot;abbr&amp;quot;: {&lt;br /&gt;
			&amp;quot;label&amp;quot;: &amp;quot;Abbreviation&amp;quot;,&lt;br /&gt;
			&amp;quot;description&amp;quot;: &amp;quot;Abbreviates the month name&amp;quot;,&lt;br /&gt;
			&amp;quot;example&amp;quot;: &amp;quot;on&amp;quot;,&lt;br /&gt;
			&amp;quot;type&amp;quot;: &amp;quot;string&amp;quot;,&lt;br /&gt;
			&amp;quot;default&amp;quot;: &amp;quot;off&amp;quot;&lt;br /&gt;
		},&lt;br /&gt;
		&amp;quot;addkey&amp;quot;: {&lt;br /&gt;
			&amp;quot;label&amp;quot;: &amp;quot;Additional sort key&amp;quot;,&lt;br /&gt;
			&amp;quot;description&amp;quot;: &amp;quot;Adds another sort key to resolve conflicts between rows with the same date&amp;quot;,&lt;br /&gt;
			&amp;quot;example&amp;quot;: &amp;quot;3&amp;quot;,&lt;br /&gt;
			&amp;quot;type&amp;quot;: &amp;quot;number&amp;quot;&lt;br /&gt;
		},&lt;br /&gt;
		&amp;quot;nowrap&amp;quot;: {&lt;br /&gt;
			&amp;quot;label&amp;quot;: &amp;quot;Wrapping&amp;quot;,&lt;br /&gt;
			&amp;quot;description&amp;quot;: &amp;quot;To turn off the suppression of word wraps, use the \&amp;quot;off\&amp;quot; parameter&amp;quot;,&lt;br /&gt;
			&amp;quot;example&amp;quot;: &amp;quot;off&amp;quot;,&lt;br /&gt;
			&amp;quot;type&amp;quot;: &amp;quot;boolean&amp;quot;,&lt;br /&gt;
			&amp;quot;default&amp;quot;: &amp;quot;off&amp;quot;&lt;br /&gt;
		}&lt;br /&gt;
	},&lt;br /&gt;
	&amp;quot;description&amp;quot;: &amp;quot;Date table sorting is used to correctly sort and display dates in a sortable table.&amp;quot;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/templatedata&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Notes==&lt;br /&gt;
===Sorting for incomplete dates===&lt;br /&gt;
;Whole months or years: A whole year or month (and year) is sorted according to its first day.&lt;br /&gt;
;Missing years: If the year is not specified, the date will be sorted as if the year were the current year.&lt;br /&gt;
;Blank dates: For no date input at all, the maximum possible sort key is used, so the entry will sort last.&lt;br /&gt;
&lt;br /&gt;
===Error handling===&lt;br /&gt;
Errors are tracked in [[:Category:Date table sorting templates with errors]].&lt;br /&gt;
&lt;br /&gt;
===Calendar choice===&lt;br /&gt;
The template is not capable of distinguishing Julian and Gregorian calendar dates. Also, it is not capable of taking a date in one calendar as input and outputting a date in the other calendar. Thus, to insure proper sorting, editors must either use one calendar for all dates, or pick a specific changeover date (for example, deciding that 4 October 1582 is Julian and all later dates are Gregorian); this would be done on an article-by article basis. Editors are also responsible for explaining to the reader whether the visible dates are Julian or Gregorian, if there is any possibility of confusion.&lt;br /&gt;
&lt;br /&gt;
===Linking===&lt;br /&gt;
The template formerly linked dates automatically, with &amp;lt;code&amp;gt;link=off&amp;lt;/code&amp;gt; used to suppress linking. In accordance with current guidelines linking of dates is no longer supported and instances of &amp;lt;code&amp;gt;link=off&amp;lt;/code&amp;gt; should be removed.&lt;/div&gt;</summary>
		<author><name>Saucy</name></author>
	</entry>
</feed>