Search code examples
extjssencha-architect

Sencha ExtJs gridcolumn formatter datetime make uppercase


I have an object that has a date column in the it inside an ArrayStore. I then bind that ArrayStore to a grid using the store property. Currently i am using the following string formatter to display the dt in a custom format: formatter: 'date("d M Y")'. This work with no issue and the dates appear as 13 Oct 2014. I would like to uppercase the Oct part. I have tried the following thing I have found online that does not work and produces errors: 'uppercase(date("d M Y"))'. There does not appear to be much documentation on fromatters besides saying it is a string.

How can I uppercase this?

columns: 
    {                       
        items: [
            { text: 'Date', dataIndex: 'date', editor: 'datefield', formatter: 'uppercase(date("d M Y"))' }
        ]
    }

Solution

  • The formats available on dates are same as here

    It doesn't appear there is a particular month with all uppercase however it could be achieved with a renderer like so:

    instead of formatter: 'uppercase(date("d M Y"))'

    something like this:

    renderer: function(value){ return Ext.util.Format.date(value, 'd M Y').toUpperCase(); }