change date format in extjs

extjs

Solution

There are the `Date` and `Ext.Date.format` classes for this. (Version 4.1)

var dt = new Date('2012-05-31')
'formatted Date:' + Ext.Date.format(dt,'d-m-Y') // 31-05-2012

Problem

I am new to extjs and want to change date format. I am fetching date from database. My date is in format -> YYYY-m-d, and want to change this format to d-m-YYYY. .

Original source