View Full Version : DateField.GetValue()

Feb 02, 2017, 12:43 PM
Hello everyone, first I'm sorry if this post was duplicated, I looked and I did not find it.

I'm trying to capture a date, but the format as it comes is giving me a headache:

<ext:DateField runat="server" FieldLabel="Vencimento" ID="txtVencimento" Format="dd/MM/yy" LabelWidth="120" LabelAlign="Top"/>

<ext:Button ...
<Click Handler="parent.App.direct.addFinanceiro(App.txtVencimento. getValue());" />

The result is, for example: "2013-05-15T17:23:53.027-03:00"

I tried to use: Ext.util ..., Ext.Date ..., as I read in some posts, but I did not find the correct class.

Can someone give me a solution?
I need to capture only the date: "15/05/2013" for example.


Feb 03, 2017, 12:42 AM
Hello, @oespiao! Welcome to Ext.NET Forums!

The value returned by a datefield's getValue() (http://docs.sencha.com/extjs/6.2.1/classic/Ext.form.field.Date.html#method-getValue) method is a JavaScript Date object (http://www.w3schools.com/jsref/jsref_obj_date.asp) instance.

But if all you need is the string value in the field, you can just use its getRawValue() (http://docs.sencha.com/extjs/6.2.1/classic/Ext.form.field.Date.html#method-getRawValue) method.

Hope this helps!

Feb 08, 2017, 5:25 PM
Perfect, thanks