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.

Details

Related Gerrit Patches:

Event Timeline

WOSlinker created this task.Sep 1 2017, 5:59 PM
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptSep 1 2017, 5:59 PM
WOSlinker updated the task description. (Show Details)Sep 1 2017, 5:59 PM
Cabayi added a subscriber: Cabayi.Sep 1 2017, 8:29 PM
Cabayi added a comment.Sep 1 2017, 8:33 PM

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 added a subscriber: TheDJ.

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 closed this task as Resolved.Sep 3 2017, 1:54 PM
matmarex assigned this task to TheDJ.
matmarex removed a project: Patch-For-Review.