https://bugzilla.wikimedia.org/show_bug.cgi?id=52842

       Web browser: ---
            Bug ID: 52842
           Summary: jquery.tablesorter: data-sort-type="isoDate" does not
                    work for dates in the format YYYY-MM-DDTHH:MM:SSZ
           Product: MediaWiki
           Version: unspecified
          Hardware: All
               URL: https://pt.wikipedia.org/w/index.php?oldid=36666729&us
                    elang=en&debug=1
                OS: All
            Status: NEW
          Keywords: javascript
          Severity: normal
          Priority: Unprioritized
         Component: JavaScript
          Assignee: [email protected]
          Reporter: [email protected]
                CC: [email protected], [email protected],
                    [email protected]
    Classification: Unclassified
   Mobile Platform: ---

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

-- 
You are receiving this mail because:
You are the assignee for the bug.
You are on the CC list for the bug.
_______________________________________________
Wikibugs-l mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/wikibugs-l

Reply via email to