Search code examples
javascriptdatedatepickersencha-touch-2date-format

Sencha Touch 2 datepicker: display another date format for chosen date


I'm using datepickerfield in Sencha Touch 2 . It works, the date is selected properly, everything's fine.

The only thing I want is to change the date format: it displays 05/13/2013, but I want May 13, 2013. Here is my code:

xtype: 'fieldset',
items: [{
    xtype: 'datepickerfield',
    name: 'mydate',
    picker : {
        yearFrom : parseInt(Ext.Date.format(new Date(), 'Y'), 10)-1,
    },
    placeHolder : 'Select Date'
}]

Solution

  • Found the solution. Adding dateFormat: 'M d, Y' was the answer on my question.