Last modified: 2014-03-09 23:39:18 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T54842, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 52842 - jquery.tablesorter: data-sort-type="isoDate" does not work for dates in the format YYYY-MM-DDTHH:MM:SSZ
jquery.tablesorter: data-sort-type="isoDate" does not work for dates in the f...
Status: PATCH_TO_REVIEW
Product: MediaWiki
Classification: Unclassified
JavaScript (Other open bugs)
1.22.0
All All
: Normal normal (vote)
: ---
Assigned To: Nobody - You can work on this!
https://pt.wikipedia.org/w/index.php?...
: javascript
Depends on:
Blocks: 31601
  Show dependency treegraph
 
Reported: 2013-08-14 12:50 UTC by Helder
Modified: 2014-03-09 23:39 UTC (History)
4 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Helder 2013-08-14 12:50:02 UTC
As you can check in the URL above, the current version[1] of the table sorter parser for "isoDate" doesn't work if the date has the format YYYY-MM-DDTHH:MM:SSZ. In the broken example above, clicking in the "Date" header doesn't change the order of the rows, while in the working example it does.

The code is using the regex /^\d{4}[\/\-]\d{1,2}[\/\-]\d{1,2}$/ to detect these dates (see #L620), and this doesn't take the time into account.

Moreover, in the parser (#L1011), there is a replacement of the form
"2000-01-01T00:00:00Z" --> "2000/01/01T00:00:00Z"
which will result in an invalid date when this value is passed to "new Date()"

[1] https://github.com/wikimedia/mediawiki-core/blob/5b17571e6917fb819d8d8a191df90dd88d468e09/resources/jquery/jquery.tablesorter.js
Comment 1 Gerrit Notification Bot 2014-03-09 23:39:16 UTC
Change 117808 had a related patch set uploaded by TheDJ:
TableSorter: Improve detection and handling of isoDate

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

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links