[CLOSED] Text of DateField showing 1/1/0001

  1. #1

    [CLOSED] Text of DateField showing 1/1/0001

    Hi, I am using a DateField that works well when selecting from date selector but it is not returning anything when user enters free text.

    <ext:DateField ID="CalcJobPricingDate" runat="server" Name="CalcJobPricingDate" HideMode="Display" AllowBlank="true" Hidden="true" />
    (The control is hidden at first but then I unhide it when user clicks a button).

    Anyways, this works:

    CalcJobPricingDate.SelectedDate.ToShortDateString()
    But sometimes our user needs to enter a free text, in a different format, for example: 20140101 (YYYYMMDD format).
    In those cases I just need the strong from "text" property.

    When I check the text property I get 1/1/0001:

    CalcJobPricingDate.Text
    How can I make the DateField return what was entered in the text box in code behind?
    Last edited by Daniil; Jun 13, 2014 at 10:09 AM. Reason: [CLOSED]
  2. #2
    Hi @Ariel,

    You can use
    this.DateField1.RawText
    As an alternative approach, you can register AltFormats for a DateField. There is a big set of default AltFormats.
    http://docs.sencha.com/extjs/4.2.1/#...cfg-altFormats

    For "20140101" it should look like this.
    Example
    <ext:DateField ID="DateField1" runat="server" AltFormats="yyyyMMdd" />
    Then you'll be able to use a DataField's SelectedDate.
    Last edited by Daniil; Jun 09, 2014 at 5:50 PM.

Similar Threads

  1. [CLOSED] Change validation text for DateField
    By rthiney in forum 2.x Legacy Premium Help
    Replies: 1
    Last Post: Oct 30, 2013, 2:03 AM
  2. Replies: 6
    Last Post: Jan 09, 2013, 10:30 AM
  3. Replies: 11
    Last Post: Mar 03, 2010, 5:46 AM
  4. Radiogroup radio boxlabel text not showing
    By Richardt in forum 1.x Help
    Replies: 4
    Last Post: Jan 19, 2010, 9:46 AM
  5. Replies: 7
    Last Post: Aug 12, 2009, 4:04 PM

Posting Permissions