Format JSON Date in Sencha Touch

Date in the JSON response will be like /Date(1340236800000)/ . In order to format it correctly in Sencha Touch, use the following code snippet

Ext.Date.format(new Date(parseInt(post._data.scheduledDate.substr(6))), 'd/m/Y');

d/m/Y is the format for your choice

post._data.scheduledDate is the JSON response object holds the date value

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s