-
5 Aug 2010 4:46 PM #1
Dates coming as NaN on Safari only
Dates coming as NaN on Safari only
I have some dates that I'm posting that are being transformed from their raw JSON response to a nice date. This works fine for Chrome but in Safari they come across as "NaN-NaN-NaN".
Do I need to do something special for Safari?
Here's the code for the transform:
In JSON, they'll look like this:Code:<textarea class="x-hidden-display" id="dieinfo-dates"> <h4>{dieName}</h4> <p>ES (Baseline): {baselineESDate:date("Y-m-d")}</p> <p>ES (Latest): {latestESDate:date("Y-m-d")}</p> </textarea>
"latestESDate":"2029-01-31 00:00:00.0"
-
7 Oct 2010 10:50 PM #2
I have the same problem. Has anyone found a solution yet?
-
7 Oct 2010 10:55 PM #3
It's a bug in Safari. You should pass a format as specified here: http://dev.sencha.com/deploy/touch/docs/?class=Date
So it will use the Touch parser instead.Evan Trimboli
Sencha Developer
Twitter - @evantrimboli
Don't be afraid of the source code!
-
7 Oct 2010 11:17 PM #4
You should explicitly convert that string to a Date.
Search the forum: http://www.google.com/coop/cse?cx=01...%3Az7of1ufqccu
Read the docs too: http://extjs.com/deploy/dev/docs/
Scope: http://extjs.com/forum/showthread.ph...642#post257642
-
7 Oct 2010 11:20 PM #5
-
7 Oct 2010 11:25 PM #6
It's a string isn't it? It's "2029-01-31 00:00:00.0"
You need to convert that to a Date object using http://dev.sencha.com/deploy/touch/d...mber=parseDate
Ext.util.Format.Date attempts to use the Date object's default conversion to create a Date object if you pass a string. But it appears that the Date object's default string conversion differs between browsers.
So you will have to convert it.Search the forum: http://www.google.com/coop/cse?cx=01...%3Az7of1ufqccu
Read the docs too: http://extjs.com/deploy/dev/docs/
Scope: http://extjs.com/forum/showthread.ph...642#post257642
-
8 Oct 2010 4:32 AM #7
Thanks
(sometimes I really hate Apple)
-
8 Oct 2010 4:33 AM #8
Thanks, I have fixed it.
(sometimes I really hate Apple)
-
28 Jan 2013 3:27 PM #9
Is this also an issue in extjs 4? How/where would you reccomend converting the dates to date-type in MVC format? My model says the type is date, do I still have to convert them?
Thank you for any help!
-
28 Jan 2013 4:49 PM #10
Similar Threads
-
daterender in xgcolumnmodel problem NaN/NaN/NaN
By DominateQ in forum Ext 2.x: Help & DiscussionReplies: 19Last Post: 22 Apr 2010, 9:25 AM -
Storing dates in grid panel as Excel-dates
By dan007 in forum Ext 3.x: Help & DiscussionReplies: 0Last Post: 2 Dec 2009, 11:02 PM -
[FIXED][2.x] Ext.num(NaN, 0) returns NaN
By mystix in forum Ext 2.x: BugsReplies: 8Last Post: 14 Mar 2009, 7:06 PM -
[SOLVED] Grid + DateTime Column + add new record = NaN-NaN-NaN
By alaska in forum Ext 2.x: Help & DiscussionReplies: 4Last Post: 29 May 2008, 1:32 PM


Reply With Quote
