How can I get only date like 02/8/2013 mm/dd/yyyy from datefield in extjs 4.0 supported on all browser.
my code is as follows
items: [{
xtype: 'datefield',
fieldLabel: 'Date',
format: 'm/d/Y',
altFormats: 'm/d/Y',
},
and i am getting a value from this field like this
date = Ext.getCmp('configuration-section-contact-form-date-of-issue').getValue();
by using above line i get plete UTC time but I want only date like 02/8/2013.how can i get please help me. thanks..
How can I get only date like 02/8/2013 mm/dd/yyyy from datefield in extjs 4.0 supported on all browser.
my code is as follows
items: [{
xtype: 'datefield',
fieldLabel: 'Date',
format: 'm/d/Y',
altFormats: 'm/d/Y',
},
and i am getting a value from this field like this
date = Ext.getCmp('configuration-section-contact-form-date-of-issue').getValue();
by using above line i get plete UTC time but I want only date like 02/8/2013.how can i get please help me. thanks..
Share Improve this question edited Oct 16, 2014 at 13:10 Oliver Watkins 13.5k38 gold badges134 silver badges249 bronze badges asked Feb 14, 2013 at 11:09 user2000423user2000423 1011 gold badge2 silver badges10 bronze badges 1-
Do not configure
altFormats
. It defaults to:m/d/Y|n/j/Y|n/j/y|m/j/y|n/d/y|m/j/Y|n/d/Y|m-d-y|m-d-Y|m/d|m-d|md|mdy|mdY|d|Y-m-d|n-j|n/j
– A1rPun Commented Feb 14, 2013 at 11:21
4 Answers
Reset to default 8You can use:
dateField.getSubmitValue();
See live example on jsfiddle
Try this:
Ext.getCmp('configuration-section-contact-form-date-of-issue').getValue().format('m/d/Y');
You can use "Ext.util.Format.Date" method to format the date in desired format.
Ext.util.Format.Date(Ext.getCmp('configuration-section-contact-form-date-of-issue').getValue(),'m/d/Y')
I had this problem today, I used that way and it worked:
var searchText = Ext.util.Format.date(Ext.getCmp('pes1').getValue(), 'd/m/Y');