PDA

View Full Version : [CLOSED] JSON object property: convert to Date value



supera
Jun 13, 2012, 8:44 PM
Hi

In client side (javascript) I'm calling a webservice that return a vbobject serialized as Json format.

One of property of object is a Date and is returned to me with this value...

/Date(-62135546400000)/

How I can convert this value to Date (javascript date) to set this value to a ext:DateInput???

Thanks for any help!

geoffrey.mcgill
Jun 13, 2012, 8:45 PM
Setting .Format="MS" should parse the value correctly.

Hope this helps.

supera
Jun 14, 2012, 11:39 AM

Daniil
Jun 14, 2012, 12:41 PM
Hi,

Please use Ext.Date.parse.
http://docs.sencha.com/ext-js/4-1/#!/api/Ext.Date-method-parse

Example

Ext.Date.parse("/Date(-62135546400000)/", "MS")

supera
Jun 14, 2012, 2:50 PM
Hi Daniil!

Works very fine!

Thanks a lot!