View Full Version : Date display without the time

9 Dec 2011, 1:19 PM
I have a field with the type datepickerfield

xtype: 'datepickerfield',
name: 'expdate',
label: 'Expense Date',
value: new Date(),
picker: { yearFrom : 2012 },
updateValue: function(newValue) {
var picker = this.getPicker();
if (this.initialized && picker) {
this.getInput().setValue(Ext.Date.format(newValue,'M d, Y'));

When I try to display it as {expdate}, it shows up as "Sat 18 2001 00:00:00 GMT 0800 (Pacific Standard Time)" etc which is a really long string to fit into my Android phone. Is there a way I can format it so it display much shorter such as "Sat 18 2001"? I don't care about the time or GMT thing.


10 Dec 2011, 6:59 AM
You can override the setValue to include a format config to do this.