Threaded View
-
18 Oct 2012 7:21 AM #1
[4.1.2] DateFormat (ISO) does not parse correctly?
[4.1.2] DateFormat (ISO) does not parse correctly?
Hi,
I'm just going into some trouble after we'd deployed/tested the application (with Ext JS 4) on a server not in the same time zone than the clients.
Originally, the date/timestamps are served in the ISO format with timezone:
Since Ext JS 3, we've used the model type "date" + dateFormat "c". If I'm correct this dateFormat wont be supported??PHP Code:// Property of record serverside
datetime : "2012-10-18T16:17:51.299+0200"
Removing the dateFormat (only type "date") works in Chrome/Firefox perfectly (because of internal JS' Date usage), but not in IE (NaN/empty grids).
Because of this issues, I've revisited the doc.. and there are some examples.
I changed the timezone of my VM to Hawaii and use a my-local timezone (Germany).
Using the library with a example string right of the documentation:
Ext.Date.parse("1997-05-16T19:23:30.12345+02:00", "c").toString()
should not be
Fri May 16 1997 19:23:30 GMT-1000 (Hawaii Normalzeit)
but should be
Fri May 16 1997 07:23:30 GMT-1000 (Hawaii Normalzeit).
In Chrome (native)
new Date("1997-05-16T19:23:30.12345+02:00")
is okay. In IE, this is NaN.
edit: Anyway, I've open a ticket.
You break down the whole issue with following one-liner:
Ext.Date.parse("2012-10-18T16:17:51.299+0000", "c")
This date should be the 18th Oct 2012, 16h17m51s (UTC) because timezone 0.
In my case, the local timezone is +0200. So, when using the line above in Ext JS 4.1.1
Thu Oct 18 2012 16:17:51 GMT+0200 (CEST)
But in Ext JS 4.1.2
Thu Oct 18 2012 18:17:51 GMT+0200 (CEST)
I tried it again, the same expression with the timezone Hawaii set up in the operating system.
In Ext JS 4.1.1
Thu Oct 18 2012 06:17:51 GMT-1000 (Hawaii Normalzeit)
But in Ext JS 4.1.2
Thu Oct 18 2012 16:17:51 GMT-1000 (Hawaii Normalzeit)
Success! Looks like we've fixed this one. According to our records the fix was applied for
a bug in our system
in
a recent build.


Reply With Quote