DateFields adds one month

  1. #1

    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>
  2. #2

    RE: DateFields adds one month

    Still haven't solved this one.

    I got rid of the CardLayout and created a new Window for each of the dialogues I wanted to show. In the Visual Studio IDE everything is working fine but when I deployed it to IIS on one of our servers the date problem is back again.

    Also, the background color that I set the panels to does not render on the server.

    
    
    
    <ext:Window ID="winPromotion" runat="server" 
    
    
    Collapsible="false" 
    
    
    Modal="True" 
    
    
    Title="Amendment"
    
    
    ShowOnLoad="false"
    
    
    CenterOnLoad="true"
    
    
    Resizable="false"
    
    
    AutoShow="false" 
    
    
    Width="355" BodyStyle="padding:5px;">
    
    
    <Body>
    
    
    <ext:Panel ID="pnlPromotion" runat="server" AutoHeight="false" Border="false" BodyStyle="background-color:#e8e8e8;">
    
    
    <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> 
    
    
    </Body>
    
    
    <Buttons>
    
    
    <ext:Button ID="btnSavePromotion" runat="server" Text="Save" Icon="Disk" CausesValidation="true">
    
    
    <AjaxEvents>
    
    
    <Click OnEvent="btnSavePChange_Click">
    
    
    <EventMask ShowMask="true" Msg="Saving P Change..." />
    
    
    <ExtraParams>
    
    
    <ext:Parameter Name="Change" Value="1" Mode="Raw" />
    
    
    <ext:Parameter Name="SearchValues" Value="Ext.encode(#{searchGrid}.getRowsValues())" Mode="Raw" />
    
    
    <ext:Parameter Name="HistoryValues" Value="Ext.encode(#{historyGrid}.getRowsValues())" Mode="Raw" />
    
    
    <ext:Parameter Name="ChangeValues" Value="Ext.encode(#{summaryGrid}.getRowsValues())" Mode="Raw" />
    
    
    </ExtraParams> 
    
    
    </Click>
    
    
    </AjaxEvents> 
    
    
    </ext:Button>
    
    
    <ext:Button ID="btnCancelPromotion" runat="server" Text="Cancel" Icon="Cancel" CausesValidation="false">
    
    
    <Listeners>
    
    
    <Click Handler="#{winPromotion}.hide(null);" />
    
    
    </Listeners>
    
    
    </ext:Button>
    
    
    </Buttons> 
    
    
    </ext:Window>

Similar Threads

  1. Replies: 2
    Last Post: Nov 01, 2013, 6:07 AM
  2. [CLOSED] [1.2] DateFields in daterange
    By FVNoel in forum 1.x Legacy Premium Help
    Replies: 2
    Last Post: Jun 05, 2012, 3:42 PM
  3. [CLOSED] V2.0 DateFields with DateRange
    By Aurelio in forum 2.x Legacy Premium Help
    Replies: 2
    Last Post: Feb 16, 2012, 4:17 PM
  4. Replies: 10
    Last Post: May 13, 2011, 2:30 PM
  5. Replies: 2
    Last Post: Jul 08, 2010, 5:28 PM

Posting Permissions