Success! Looks like we've fixed this one. According to our records the fix was applied for TOUCH-3885 in Sprint 29.
  1. #1
    Sencha User
    Join Date
    Oct 2012
    Location
    Poland
    Posts
    67
    Vote Rating
    3
    szimek is on a distinguished road

      0  

    Default Ext.util.Format.date ignores timezone in ISO 8601 dates in older browsers

    Ext.util.Format.date ignores timezone in ISO 8601 dates in older browsers


    REQUIRED INFORMATION

    Ext version tested:
    • Sencha Touch 2.1
    Browser versions tested against:
    • Android 2.3.6
    • Android 4.2.1
    Description:

    In browsers without native support for parsing dates in ISO 8601 format (e.g. Android 2.3.6), Ext.util.Format.date ignores local timezone. E.g. when parsing date like 2013-01-04T15:00:00Z in GMT +1 time zone, Android 2.3.6 will incorrectly return 15:00 and Android 4.2.1 (or iOS6) will correctly return 16:00.

    Steps to reproduce the problem:
    • Call Ext.util.Format.date("2013-01-04T15:00:00Z", "H:i") in Android 2.3.6 WebView (it probably works in a browser as well).
    The result that was expected:
    • 16:00
    The result that occurs instead:
    • 15:00
    Test Case:
    Code:
    Ext.util.Format.date("2013-01-04T15:00:00Z", "H:i")
    There are few libraries for parsing dates in ISO8601 format (e.g. https://github.com/csnover/js-iso860...ter/iso8601.js), so it should be possible to add correct (or at least more correct) implementation for browsers without native support.

    Currently the custom code for parsing ISO8601 dates looks like this (from http://docs.sencha.com/touch/2-0/sou...-method-date):

    Code:
    iso8601SplitRe: /[- :T\.Z\+]/
    ...
    date = value.split(this.iso8601SplitRe);                    
    date = new Date(date[0], date[1]-1, date[2], date[3], date[4], date[5]);

  2. #2
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    St. Louis, MO
    Posts
    33,710
    Vote Rating
    436
    mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of

      0  

    Default


    Thanks for the report! I have opened a bug in our bug tracker.

Tags for this Thread