tags:

views:

1437

answers:

2

I have a object that im serializing to a JSON object using JSON.Net. This object is then being consumed by a JSON Store which is attached to a ExtJs GridPanel.

All fields except date fields render fine , the only way i can render date fields is if i use text columns. But then i get the following /Date(1293746400000+0200)/ rendered as text which is useless.

I know i need to convert that somehow to a proper date object but i have not idea how atm.

Let me know if you need more info.

+1  A: 

JSON.Net has various date/time converters to help you deal with this. See this blog post for some details. So you could use the JavaScriptDateTimeConverter for example, then eval the result into a JS date object. I can't recall off the top of my head how an Ext store will deal with that, but maybe it will point you in the right direction.

bmoeskau
Thanks all i needed to do was changed the convertor to JavaScriptDateTimeConverter and it woked correctly , i obviously had to made the columns 'datecolumn' and set the datatype to date.
RC1140
+1  A: 

Have a look at here.

In most cases you can pass your own formatted string (i use "yyyy-MM-dd" in my projects as i don't need time) and re-use it on the other side (format it as a valid date constructor).

Alex Bagnolini