Mar 19, 2009, 7:12 PM
DateFields adds one month
It will be hard to provide an example of the problem I have because of trying to extract it from my companies pages and still maintain the same conditions so I want to start by just asking to see if anyone has encountered a similar problem if I explain it.
Without putting the whole markup this below shows that I have a Window with a CardLayout giving me several forms which I can choose to show or hide dependant on the caller of the form.
What is happening is that when I choose a date using the drop down calendar of the DateField the date in the textfield is wrong by one month. For example if I choose 05/03/2009 on the calendar. It puts 05/04/2009 in the TextField.
Does anyone have any suggestions?
<ext:Window ID="winPChange" runat="server"
Collapsible="false"
Modal="True"
Title="Amendment"
ShowOnLoad="false"
CenterOnLoad="true"
Resizable="false"
AutoShow="false"
Width="350">
<Body>
<ext:Hidden ID="hidEditMode" runat="server" HideInDesign="True" />
<ext:Hidden ID="hidPChangeType" runat="server" HideInDesign="True" />
<ext:Hidden ID="hidPChangeEmployeeID" runat="server" HideInDesign="True" />
<ext:FitLayout ID="FitLayout1" runat="server">
<ext:Panel ID="pnlPChangeCards" runat="server" Header="false" ActiveItem="0" Border="false" BodyStyle="padding:6px;">
<Body>
<ext:CardLayout runat="server">
<%-- The order that these panels are added are important in a Card Layout as the position is the --%>
<%-- index used to set each one as the active item when required --%>
<%-- the order in this case matches the Enum value minus 1 that have been set up for PChangeTypes --%>
<%-- Promotion Form (Index 0)--%>
<ext:Panel ID="pnlPromotion" runat="server" Border="false" HideMode="Offsets">
<Body>
<ext:FormLayout ID="frmPromotion" runat="server" LabelWidth="120">
<ext:Anchor>
<ext:DateField ID="dtePromotionEffective"
runat="server"
Width="200"
FieldLabel="Effective Date"
Format="dd/MM/yyyy"
AltFormats="dd/MM/yy"
AllowBlank="false"
InvalidText="Date format should be dd/MM/yyyy" />
</ext:Anchor>
<ext:Anchor>
<ext:ComboBox ID="cboPromotionJobTitle" runat="server"
Width="200"
FieldLabel="New Job Title"
StoreID="jobsStore"
DisplayField="JobTitle"
ValueField="JobTypeID"
Mode="Local"
SelectOnFocus="true"
EmptyText="Select a position..."
TriggerAction="All"
AllowBlank="false" />
</ext:Anchor>
<ext:Anchor>
<ext:TextField ID="txtPromotionOldHours"
runat="server"
FieldLabel="Current Contracted Hrs"
Width="200"
ReadOnly="true" />
</ext:Anchor>
<ext:Anchor>
<ext:NumberField ID="numPromotionNewHours"
runat="server" Width="200" FieldLabel="New Contracted Hours" AllowBlank="false"/>
</ext:Anchor>
<ext:Anchor>
<ext:ComboBox ID="cboPromotionLocation" runat="server"
FieldLabel="Location"
EmptyText="Select a location..."
StoreID="locationsStore"
DisplayField="LocationName"
ValueField="LocationID"
Mode="Local"
TypeAhead="true"
SelectOnFocus="true" Width="200" TriggerAction="All" AllowBlank="false" />
</ext:Anchor>
<ext:Anchor>
<ext:TextArea ID="txtPromotionComments" runat="server" Width="198" FieldLabel="Comments"/>
</ext:Anchor>
<ext:Anchor>
<ext:TextArea ID="txtPromotionAmendedComments"
runat="server" Width="198" FieldLabel="Notes" Disabled="true" />
</ext:Anchor>
</ext:FormLayout>
</Body>
</ext:Panel>