-
3 Apr 2009 6:15 AM #21
Only one solution worked for me, the post #11.
PS: I'm using the library NewtonSoft.Json instead of the M$ Json.Imagination is more important than knowledge.
-
22 Sep 2009 8:15 AM #22
Finally!
Finally!
Got it working:
Code:var rawData = "{\"Test\":\"\\/Date(1247094000000+0100)\\/\"}"; var dateParser = new RegExp('(^|[^\\\\])\\"\\\\/Date\\((-?[0-9]+)(?:[a-zA-Z]|(?:\\+|-)[0-9]{4})?\\)\\\\/\\"', 'g'); var exp = rawData.replace(dateParser, "$1new Date($2)"); alert(eval('('+ exp +')'));
-
22 Sep 2009 9:00 AM #23
i'm assuming you're using a pre-2.3.0 / 3.0.0 version of the library?
support for the m$ format has already been added to both 2.3.0 and 3.0+ using the parse format "M$".
see the docs for Date for more info.
additionally, you might want to take a look at the following working test case:
http://www.sencha.com/forum/showthread.php?p=346185
Sencha Docs / Ext 3.x - ( Docs | Examples )
Learning Center / Saki's Examples (for 2.x) / HOWTO - ( Report Bugs | Post Proper Code )
-
23 Sep 2009 12:30 AM #24
Err...yes. Yes indeed.
We haven't upgraded to above 2.2 yet.
Sorry...
-
24 Aug 2012 5:38 AM #25
Fixed -- Enjoy (ExtJS ver 4.1)
Fixed -- Enjoy (ExtJS ver 4.1)
Ext.override(Ext.form.field.Date, {
valueToRaw: function (value) {
var val = this.formatDate(this.parseDate(value));
if (!val) {
var re = new RegExp('\/Date\\(([-+])?(\\d+)(?:[+-]\\d{4})?\\)\/'),
val = (value || '').match(re);
val = val ? new Date(((val[1] || '') + val[2]) * 1) : null;
return this.formatDate(this.parseDate(val));
}
else
return val;
}
});


Reply With Quote