-
7 Jan 2013 9:39 AM #1
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
- Android 2.3.6
- Android 4.2.1
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).
- 16:00
- 15:00
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.Code:Ext.util.Format.date("2013-01-04T15:00:00Z", "H:i")
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]);
-
7 Jan 2013 9:41 AM #2Sencha - Senior Forum Manager
- Join Date
- Mar 2007
- Location
- St. Louis, MO
- Posts
- 33,624
- Vote Rating
- 434
Thanks for the report! I have opened a bug in our bug tracker.
Success! Looks like we've fixed this one. According to our records the fix was applied for
TOUCH-3885
in
Sprint 29.


Reply With Quote