X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;ds=sidebyside;f=tests%2Fqunit%2Fsuites%2Fresources%2Fjquery%2Fjquery.tablesorter.parsers.test.js;h=01589c3360b1c788b8a003b52c75d85743f276e0;hb=5fa4cdf860c79b32ab6ef034c6d9420c2727f695;hp=200395e20eef6aa9b1fd1afcf1113210219e69db;hpb=d5a7166771613dfe4ed9fb75fa5efeced6134bd1;p=lhc%2Fweb%2Fwiklou.git diff --git a/tests/qunit/suites/resources/jquery/jquery.tablesorter.parsers.test.js b/tests/qunit/suites/resources/jquery/jquery.tablesorter.parsers.test.js index 200395e20e..01589c3360 100644 --- a/tests/qunit/suites/resources/jquery/jquery.tablesorter.parsers.test.js +++ b/tests/qunit/suites/resources/jquery/jquery.tablesorter.parsers.test.js @@ -174,40 +174,46 @@ parserTest( 'Y Dates', 'date', YDates ); ISODates = [ - [ '2000', false, 0, 'Plain 4-digit year' ], - [ '2000-01', false, 0, 'Year with month' ], - [ '2000-01-01', true, 946684800000, 'Year with month and day' ], - [ '2000-13-01', true, -Infinity, 'Non existant month' ], - [ '2000-01-32', true, -Infinity, 'Non existant day' ], + [ '', false, -Infinity, 'Not a date' ], + [ '2000', false, 946684800000, 'Plain 4-digit year' ], + [ '2000-01', true, 946684800000, 'Year with month' ], + [ '2000-01-01', true, 946684800000, 'Year with month and day' ], + [ '2000-13-01', false, 978307200000, 'Non existant month' ], + [ '2000-01-32', true, 949363200000, 'Non existant day' ], + [ '2000-01-01T12:30:30', true, 946729830000, 'Date with a time' ], [ '2000-01-01T12:30:30Z', true, 946729830000, 'Date with a UTC+0 time' ], - [ '2000-01-01T24:30:30Z', true, -Infinity, 'Date with invalid hours' ], - [ '2000-01-01T12:60:30Z', true, -Infinity, 'Date with invalid minutes' ], + [ '2000-01-01T24:30:30Z', true, 946773030000, 'Date with invalid hours' ], + [ '2000-01-01T12:60:30Z', true, 946728000000, 'Date with invalid minutes' ], + [ '2000-01-01T12:30:61Z', true, 946729800000, 'Date with invalid amount of seconds, drops seconds' ], [ '2000-01-01T23:59:59Z', true, 946771199000, 'Edges of time' ], [ '2000-01-01T12:30:30.111Z', true, 946729830111, 'Date with milliseconds' ], [ '2000-01-01T12:30:30.11111Z', true, 946729830111, 'Date with too high precision' ], - [ '2000-01-01T12:30:30,111Z', true, -Infinity, 'Date with milliseconds and , separator' ], + [ '2000-01-01T12:30:30,111Z', true, 946729830111, 'Date with milliseconds and , separator' ], [ '2000-01-01T12:30:30+01:00', true, 946726230000, 'Date time in UTC+1' ], [ '2000-01-01T12:30:30+01:30', true, 946724430000, 'Date time in UTC+1:30' ], [ '2000-01-01T12:30:30-01:00', true, 946733430000, 'Date time in UTC-1' ], [ '2000-01-01T12:30:30-01:30', true, 946735230000, 'Date time in UTC-1:30' ], [ '2000-01-01T12:30:30.111+01:00', true, 946726230111, 'Date time and milliseconds in UTC+1' ], [ '2000-01-01Postfix', true, 946684800000, 'Date with appended postfix' ], - [ '2000-01-01 Postfix', true, 946684800000, 'Date with separate postfix' ] - /* Disable testcases, because behavior is browser dependant */ - /* - [ '2000-11-31', true, 0, '31 days in 30 day month' ], - [ '50-01-01', false, -60589296000000, 'Year with just two digits' ], - [ '-1000-01-01', true, -93724128000000, 'Year BC' ], - [ '+1000-01-01', true, -30610224000000, 'Date with +sign' ], - [ '2000-01-01 12:30:30Z', true, 0, 'Date and time with no T marker' ], + [ '2000-01-01 Postfix', true, 946684800000, 'Date with separate postfix' ], + [ '2 Postfix', false, -62104060800000, 'One digit with separate postfix' ], + [ 'ca. 2', false, -62104060800000, 'Three digit with separate prefix' ], + [ '~200', false, -55855785600000, 'Three digit with appended prefix' ], + [ 'ca. 200[1]', false, -55855785600000, 'Three digit with separate prefix and postfix' ], + [ '2000-11-31', true, 975628800000, '31 days in 30 day month' ], + [ '50-01-01', true, -60589296000000, 'Year with just two digits' ], + [ '2', false, -62104060800000, 'Year with one digit' ], + [ '02-01', true, -62104060800000, 'Year with one digit and leading zero' ], + [ ' 2-01', true, -62104060800000, 'Year with one digit and leading space' ], + [ '-2-10', true, -62206704000000, 'Year BC with month' ], + [ '-9999', false, -377705116800000, 'max. Year BC' ], + [ '+9999-12', true, 253399622400000, 'max. Date with +sign' ], + [ '2000-01-01 12:30:30Z', true, 946729830000, 'Date and time with no T marker' ], [ '2000-01-01T12:30:60Z', true, 946729860000, 'Date with leap second' ], - [ '2000-01-01T12:30:30-24:00', true, 946816230000, 'Date time in UTC-24' ], - [ '2000-01-01T12:30:30+24:00', true, 946643430000, 'Date time in UTC+24' ], - [ '2000-01-01T12:30:30+0100', true, 946726230000, 'Time without separator in timezone offset' ] - // No "Z", uses local timezone: - [ '2000-01-01T12:30:30', true, 946729830000, 'Date with a time' ], - [ '2000-01-01T12:30:61Z', true, 946729800000, 'Date with invalid amount of seconds, drops seconds' ], - */ + [ '2000-01-01T12:30:30-23:59', true, 946816170000, 'Date time in UTC-23:59' ], + [ '2000-01-01T12:30:30+23:59', true, 946643490000, 'Date time in UTC+23:59' ], + [ '2000-01-01T123030+0100', true, 946726230000, 'Time without separators' ], + [ '20000101T123030+0100', false, 946726230000, 'All without separators' ] ]; parserTest( 'ISO Dates', 'isoDate', ISODates );