PDA

View Full Version : DatePicker display format



parky128
19 Dec 2011, 8:28 AM
Is it possible to specify the display format of a DatePicker control e.g. 'd-M-Y'? I couldn't see anything obvious in the API docs.

mitchellsimoens
19 Dec 2011, 8:43 AM
It looks like it gets set off of Ext.util.Format.defaultDateFormat

parky128
19 Dec 2011, 8:48 AM
I can't see that in the API docs, where can I find this?

mitchellsimoens
19 Dec 2011, 8:53 AM
I can't see that in the API docs, where can I find this?

I looked at the source... the updateValue method. Don't be afraid to look at the source, it's actually quite small for DatePicker

parky128
19 Dec 2011, 8:59 AM
I have just taken a look at the source too (for PR3) and cannot see any updateValue function.

Im looking in src\picker\date.js is this the correct file?

parky128
19 Dec 2011, 9:08 AM
I answered my own question, was looking at the wrong source file! I have found what I'm looking for now, and got the date picker displaying in the format I require.

I am using MVC and in my launch method I am setting it like so:


Ext.util.Format.defaultDateFormat = 'd-M-Y';

mitchellsimoens
19 Dec 2011, 9:23 AM
Still think it would be nice to be able to override it in the config object

rdougan
19 Dec 2011, 4:19 PM
Agreed. I added it as a ticket.