MinDate Property Does not working in DateField

  1. #1

    MinDate Property Does not working in DateField

    HI Below code, i am unable to get the MinDate Working. kindly help me out
     <ext:Viewport ID="d" runat="server">
            <Items>
                <ext:FormLayout ID="r" runat="server" Visible="true">
                    <Content>
                        <ext:DateField ID="dfRSStart" runat="server" Width="500" EmptyText="   /   /   "
                            FieldLabel="Start" Editable="false" MinDate="<%# DateTime.Now %>" Format="m/d/Y"
                            MinText="Must be a future date." IndicatorIcon="BulletRed" >
                           
                                                    </ext:DateField>
                    </Content>
                </ext:FormLayout>
            </Items>
        </ext:Viewport>
    Last edited by Daniil; Feb 02, 2012 at 8:47 AM. Reason: Please use [CODE] tags
  2. #2
    Hi,

    Please set up
    AutoDataBind="true"
    for the DateField.
  3. #3

    Mindate property

    Hi Daniil, thank you. its working now. i made the datefield controll in View mode.
    for todays date working fine but when i see the same the field in view mode next day i get the Error bullet, how i can remove this?

    Thank you
  4. #4
    Well, you should remove
    IndicatorIcon="BulletRed"
    to don't see that.
  5. #5

    Mindate property

    Hi Daniil,
    i done that also. after doing that my Indicator icon gone. but i am getting the Red color border.

    my approach is like below.
    step 1: create new
    step 2: give all details and in date field the min date is Today. (all records save to database)
    step 3: open the Details screen and select one item to view the details
    step4: then the item details fetch from the Database table.

    when i get the dat of the item that time i get the RedBorder arounf the DateField saying Date must be feature Date.
    i want to eliminate this in view mode.

    Thank you
  6. #6
    Please provide a sample to reproduce the problem.
  7. #7

    Mindate property

    Hi Daniil,
    Here are my sample code.


    <%@ Page Title="Home Page" Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs"
        Inherits="WortkingArea._Default" ClassName="Dafault" %>
    
    <%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
    <head id="Head1" runat="server">
        <title></title>
        <ext:ResourceManager ID="ResourceManager1" runat="server">
        </ext:ResourceManager>
        
        <script runat="server">
            protected void Page_Load(object sender, EventArgs e)
            {
                if (!Page.IsPostBack)
                {
                    //took the date less than todays date
                    dfRSStart.Text = "02/01/2012";
                }
    
            }
        </script>
    </head>
    <body>
        <form id="form1" runat="server">
        <ext:Viewport ID="d" runat="server">
            <Items>
                <ext:FormPanel runat="server">
                    <Items>
                        <ext:DateField ID="dfRSStart" runat="server" Width="500" EmptyText="   /   /   "
                            AutoDataBind="true" FieldLabel="Start" Editable="false" MinDate="<%# DateTime.Now %>"
                            Format="m/d/Y" MinText="Must be a future date." ValidationEvent="true" ReadOnly="true">
                        </ext:DateField>
                    </Items>
                </ext:FormPanel>
            </Items>
        </ext:Viewport>
                
        </form>
    </body>
    </html>
    Last edited by Daniil; Feb 13, 2012 at 2:13 PM. Reason: Please use [CODE] tags
  8. #8
    Well, it is a validation error which appears to be displayed correctly according to MinDate functionality.

    It means that a currently selected date is less than MinDate.
  9. #9

    Handled it in javascript

    Hi Daniil,

    it was giving validation error when i set the Mindate. so i removed it and handled it by javascript. now working fine.
    i thank you for your support. kindly close the thread.


    Thanks and Regards
    Anil kurahatti

Similar Threads

  1. Replies: 1
    Last Post: Sep 23, 2011, 8:42 AM
  2. Replies: 1
    Last Post: Sep 13, 2011, 2:22 PM
  3. [1.0] DateField.Format not working
    By nextSTEP in forum 1.x Help
    Replies: 4
    Last Post: Nov 18, 2010, 10:18 AM
  4. [CLOSED] Date picker mindate bug?
    By Jurke in forum 1.x Legacy Premium Help
    Replies: 4
    Last Post: Apr 02, 2009, 11:28 AM
  5. Datefield Readonly not working
    By EzaBlade in forum 1.x Help
    Replies: 0
    Last Post: Feb 12, 2009, 9:28 AM

Posting Permissions