Help:Sortable tables: Difference between revisions

Content deleted Content added
Line 1,630:
This shows that any full date works ''without'' '''data-sort-type=date''' in the table. Month-day-year or day-month-year. If a number for a day is missing, date sorting is broken. Abbreviated months work too. The year must be on the end, and a number can not be used for the month. Either will break date sorting.
 
SortingDate sorting works correctly in the first 2 tables below. Years before 100 (for example, year 99) break sorting.
 
<div style="display:inline-table; vertical-align:top;">
Line 1,677:
</div>
 
'''data-sort-type=date''' in the header for the date column allows date sorting to work for all entries not missing a day number. So it is good to add it in case editors forget day numbers for some entries. That can be fixed later. The rest of the dates will sort correctly by date. Test date sorting below. '''Some entries below are missing the day number.''' They end up at the top or bottom of the ''data-sort-type=date'' list upon sorting. The list below without ''data-sort-type=date'' does not sort by date.
 
The 2 tables below are identical except for the addition of '''data-sort-type=date''' to the second table.
 
<div style="display:inline-table; vertical-align:top;">
{| class="wikitable sortable"
|-
! Full dates.<br>A mix of formats
|-
| Dec 5, 1999
Line 1,720 ⟶ 1,722:
{| class="wikitable sortable"
|-
! data-sort-type=date | Full dates.<br><code>data-sort-type=date</code>
|-
| Dec 5, 1999