Page MenuHomePhabricator

Table Date Sorting doesn't work correctly with blank fields
Closed, ResolvedPublic

Description

With a table such as:

{| class="wikitable sortable"
! Name || Date || Number
|-
| A || 1967-01-01 || 1967
|-
| B || 1985-01-01 || 1985
|-
| C || 2001-01-01 || 2001
|-
| D || 1825-01-01 || 1825
|-
| E ||  || 
|}

When sorting on the date column, the blank values are placed in the middle of the table rather than at one of the ends.

Event Timeline

A more tightly grouped set of dates in the table shows that blanks are interpreted as 1970-01-01.

{| class="wikitable sortable"
! Name || Date || Number
|-
| A || 1969-12-31 || 1969
|-
| B || 1970-01-02 || 1970
|-
| E ||  || 
|}
Cabayi renamed this task from Table Date Sorting doesn't not work corretly with blank fields to Table Date Sorting doesn't work correctly with blank fields.Sep 1 2017, 8:35 PM
TheDJ subscribed.

Thanks for reporting, I accidentally broke this a couple of weeks ago.

Change 375514 had a related patch set uploaded (by TheDJ; owner: TheDJ):
[mediawiki/core@master] TableSorter: Sort unrecognized dates as -Infinity

https://gerrit.wikimedia.org/r/375514

Change 375514 merged by jenkins-bot:
[mediawiki/core@master] TableSorter: Sort unrecognized dates as -Infinity

https://gerrit.wikimedia.org/r/375514

matmarex assigned this task to TheDJ.
matmarex removed a project: Patch-For-Review.