Oct 07, 2010, 6:03 PM
[CLOSED] DateField data format problem
I have the following problem with the DateField control:
context: I set the Culture by code as follows:
I enter "23/9/2011" into the control and when it loses the focus, the value changes automatically to 9/11/2012.
If I enter 23/09/2011 it doesn't happen.
Another unexpected case is:
I enter "09/23/2011" (it should fail the validation because the format is d/m/y). But when the control loses focus it's refreshed automatically to 09/11/2012. I'd expect a validation error message.
This is the code of the page:
context: I set the Culture by code as follows:
((ResourceManager) objControl). Locale = "en-US"
I also force the date format to match the server's format with:dpClosingDate.Format = "d/m/Y";
and I get the following unexpected result:I enter "23/9/2011" into the control and when it loses the focus, the value changes automatically to 9/11/2012.
If I enter 23/09/2011 it doesn't happen.
Another unexpected case is:
I enter "09/23/2011" (it should fail the validation because the format is d/m/y). But when the control loses focus it's refreshed automatically to 09/11/2012. I'd expect a validation error message.
This is the code of the page:
<ext:Window ID="itemWindow" runat="server" Title="Periods" Icon="Time"
Width="410px" Height="188px" AutoShow="false" Modal="true" Hidden="true" Resizable="false" BodyBorder="false">
<Items>
<ext:Panel ID="pnlGeneral" runat="server" Border="true" BodyStyle="padding:5px;">
<Content>
<ext:FormPanel ID="frmGeneral"
runat="server"
MonitorPoll="500"
MonitorValid="true"
AutoWidth="true"
Title="Periods Edition"
PaddingSummary="8px 8px 0"
BodyStyle="padding:5px;"
Layout="Form">
<Defaults>
<ext:Parameter Name="MsgTarget" Value="side" />
</Defaults>
<Items>
<ext:DateField
ID="dpClosingDate" runat="server" Vtype="daterange" FieldLabel="Closing date" AllowBlank="false" >
<CustomConfig>
<ext:ConfigItem Name="endDateField" Value="#{dpPaymentDate}" Mode="Value" />
</CustomConfig>
</ext:DateField>
<ext:DateField
ID="dpPaymentDate" runat="server" Vtype="daterange" FieldLabel="Payment date" AllowBlank="false" >
<CustomConfig>
<ext:ConfigItem Name="startDateField" Value="#{dpClosingDate}" Mode="Value" />
</CustomConfig>
</ext:DateField>
</Items>
</ext:FormPanel>
</Content>
</ext:Panel>
</Items>
</ext:Window>
Last edited by Daniil; Oct 09, 2010 at 5:07 PM.
Reason: [CLOSED]