Page MenuHomePhabricator

Sort <time> tag as date using datetime attribute
Open, Needs TriagePublic

Description

When sorting a table, cells containing a <time> tag should be considered as a date instead of text.
If the tag contain a datime attribute it should be used to determine the date (ISO format), otherwise the cell content should be used (ISO too if it follow HTML5 standard)

Example of valid time tag :
<time datetime="2016-11-07">Monday, November 7, 2016</time>
<time>2016-11-07</time>

Event Timeline

Zebulon84 created this task.Nov 7 2016, 7:37 AM
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptNov 7 2016, 7:37 AM
matmarex added a subscriber: matmarex.

This shouldn't be difficult to implement. We handle <img alt="…">, which is basically the same thing in this context. See the getElementSortKey() function in tablesorter source code.

Restricted Application added a subscriber: TerraCodes. · View Herald TranscriptNov 7 2016, 7:32 PM
haloxwiz claimed this task.Dec 7 2016, 9:10 AM

Change 325916 had a related patch set uploaded (by Harish halo):
Add <time> as date in ISO format when sorted

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

Change 325916 abandoned by Harish halo:
Add <time> as date in ISO format when sorted

Reason:
Wrong and looks complex with parsing, hence i thought we can go with 325915 itself.

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

Change 325916 restored by Harish halo:
Add <time> as date in ISO format when sorted

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

Framawiki moved this task from Backlog to Doing on the good first task board.Dec 2 2017, 1:31 PM
Aklapper removed haloxwiz as the assignee of this task.Oct 15 2020, 1:32 PM
Aklapper edited projects, added Patch-Needs-Improvement; removed Patch-For-Review.
Aklapper added a subscriber: haloxwiz.

Removing inactive task assignee

Annysah01 added a subscriber: Annysah01.

Hello @Aklapper Can I work on this?

Change 325916 abandoned by Thiemo Kreuz (WMDE):
[mediawiki/core@master] Add <time> as date in ISO format when sorted

Reason:
Inactive for 4 years and very incomplete anyway, as far as I can see.

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

@Annysah01: Hi! This task has been assigned to you a while ago. How is it going? Do you need any help?