Page MenuHomePhabricator

QUnit test "jquery.tablesorter.parsers: ISO Dates" fails in Firefox
Closed, ResolvedPublic

Description

Trying to reproduce T112717 I found a (recently introduced) error that doesn't happen on Chrome or Safari:

jquery.tablesorter.parsers: ISO Dates

  1. Sortkey: Date with a time
  • Expected: 946729830000
  • Result: 946758630000

Code from:

jquery.tablesorter.parsers.test.js
..
 [ '2000-01-01T12:30:30', true, 946729830000, 'Date with a time' ],
 [ '2000-01-01T12:30:30Z', true, 946729830000, 'Date with a UTC+0 time' ],
`
new Date(946729830000)
> Date 2000-01-01T12:30:30.000Z
new Date(946758630000)
> Date 2000-01-01T20:30:30.000Z

Looks like when the Z is omitted from the ISO date format, Firefox assumes the user's local timezone, whereas Chrome and Safari assume UTC.

Event Timeline

Is there already an upstream bug report with Firefox? http://ecma-international.org/ecma-262/5.1/#sec-15.9.1.15 clearly states "The value of an absent time zone offset is 'Z'."

Note there are an assortment of tests commented, because of a whole slew of inconsistencies between browsers date/time parsing. we can either make it match both browser behaviors, or comment this one as well.

MatthiasDD claimed this task.
MatthiasDD subscribed.

This task is now resolved with Change 287449 jquery.tablesorter: Improve detection and handling of isoDate.
Because the parser isoDate build the date instead with new Date("...")
now with isodate.setUTCHours(h,m,s,ms).