DateField Enable Only 3rd Day of Every Month and Disable the others.

  1. #1

    DateField Enable Only 3rd Date of Every Month and Disable the others.

    Hi,

    I have some problem on customizing selectable dates in DateField.
    Here is my current code.

    <%@ Page Language="C#" %>
    
    <%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
    
    <script runat="server">
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!X.IsAjaxRequest)
            {
                dfMain.DisabledDays = new int[] { 0, 1, 2, 4, 5, 6 };
                dfMain.UpdateDisabledDays();
            }
        }
    </script>
    
    <!DOCTYPE html>
    
    <html>
    <head runat="server">
        <title>Ext.NET Examples</title>
    
        <script type="text/javascript">
        </script>
    </head>
    <body>
        <ext:ResourceManager runat="server" />
        <ext:DateField
            ID="dfMain"
            runat="server"
            AutoDataBind="true"
            MinDate="<%# DateTime.Now %>"
            Vtype="daterange"
            FieldLabel="Select Date" />
    </body>
    </html>
    With this code, I can enable only third DAY (wednesday) in the datefield.
    But now I want to enable only 3rd DATE of every month so the other date 1, 2, 4, 5, ..., 31 are disabled (3 is only example, the real application can be any date 1-31).
    It will be tricky on some date like 31st (because not every month have 31st date). Maybe in some month like february, 28th is enabled when 30th is enabled on another month.

    How can I do this?
    Sorry for my bad english.
    Last edited by Kuro13; Sep 27, 2017 at 1:19 PM.

Similar Threads

  1. DateField Picker Month & Year Not showing properly
    By rkganapathy in forum 2.x Help
    Replies: 0
    Last Post: May 10, 2017, 10:12 AM
  2. [CLOSED] Default month of Datefield always today
    By Bert76 in forum 1.x Legacy Premium Help
    Replies: 3
    Last Post: Jul 20, 2011, 4:45 PM
  3. [CLOSED] ISSUE MONTH PLUGIN ON DATEFIELD
    By ashton.lamont in forum 1.x Legacy Premium Help
    Replies: 8
    Last Post: Mar 02, 2010, 1:01 PM
  4. How to accept only month & year in a DateField Control ?
    By n_s_adhikari@rediffmail.com in forum 1.x Help
    Replies: 2
    Last Post: Sep 23, 2009, 4:45 PM
  5. datefield - month not rendering
    By Tbaseflug in forum 1.x Help
    Replies: 0
    Last Post: Jul 14, 2009, 4:23 PM

Tags for this Thread

Posting Permissions