[CLOSED] [Bug] 1.5 DisabledDate does not disable correct date on when date is midnight.

  1. #1

    [CLOSED] [Bug] 1.5 DisabledDate does not disable correct date on when date is midnight.

    SetDate.DisabledDates.Add( new DisabledDate( d ) );
    SetDate is a DatePicker
    d = 11/24/12 00:00am

    Disables 11/23

    I'm guessing this is an extjs bug?
    Last edited by Daniil; Nov 21, 2012 at 8:09 PM. Reason: [CLOSED]
  2. #2
    Quote Originally Posted by michaeld View Post
    I'm guessing this is an extjs bug?
    I don't think so. I believe this is a defect in Ext.NET.

    The issue appears to be a problem with how the DateTime object is serialized in the DisabledDates collection.

    Here's a simplified .aspx code sample demonstrating how to reproduce the issue.

    Example

    <%@ Page Language="C#" %>
    
    <%@ Register assembly="Ext.Net" namespace="Ext.Net" tagprefix="ext" %>
    
    
    <script runat="server">
        protected void Page_Load(object sender, EventArgs e)
        {
            this.DatePicker1.SelectedDate = DateTime.Today.AddDays(-10);
            
            this.DatePicker1.DisabledDates.Add(new DisabledDate(DateTime.Today));
        }
    </script>
    
    
    <!DOCTYPE html>
        
    <html>
    <head runat="server">
        <title>Ext.NET Example</title>
    </head>
    <body>
        <form runat="server">
            <ext:ResourceManager runat="server" />
            
            <ext:DatePicker ID="DatePicker1" runat="server" FieldLabel="Date" />
        </form>
    </body>
    </html>
    The DisabledDate is serialized to the following JavaScript... which is not correct:

    disabledDates : [ new Date(1353394800000 - 0700) ]
    Should be an easy fix.
    Geoffrey McGill
    Founder
  3. #3
    Hi,

    A bug is here:
    Ext.Net.Utilities.DateTimeUtils.DateNetToJs(DateTime.Today);
    We are investigating a possible fix.
  4. #4
    Quote Originally Posted by geoffrey.mcgill View Post
    I don't think so. I believe this is a defect in Ext.NET.

    The issue appears to be a problem with how the DateTime object is serialized in the DisabledDates collection.

    Here's a simplified .aspx code sample demonstrating how to reproduce the issue.

    Example

    <%@ Page Language="C#" %>
    
    <%@ Register assembly="Ext.Net" namespace="Ext.Net" tagprefix="ext" %>
    
    
    <script runat="server">
        protected void Page_Load(object sender, EventArgs e)
        {
            this.DatePicker1.SelectedDate = DateTime.Today.AddDays(-10);
            
            this.DatePicker1.DisabledDates.Add(new DisabledDate(DateTime.Today));
        }
    </script>
    
    
    <!DOCTYPE html>
        
    <html>
    <head runat="server">
        <title>Ext.NET Example</title>
    </head>
    <body>
        <form runat="server">
            <ext:ResourceManager runat="server" />
            
            <ext:DatePicker ID="DatePicker1" runat="server" FieldLabel="Date" />
        </form>
    </body>
    </html>
    The DisabledDate is serialized to the following JavaScript... which is not correct:

    disabledDates : [ new Date(1353394800000 - 0700) ]
    Should be an easy fix.
    I just discovered that this example works well for me. Today is disabled in the DatePicker.

    I see
    disabledDates:[new Date(1353441600000+0400)]
    in the Page Sources.

    Geoffrey, could you clarify does not the example work for you? Or are you just expecting another way of serialization like "new Date(2012, 10, 21)"?

    @michaeld, could you also tell the Geoffrey's example works or not for you?
  5. #5
    The fix has been committed to SVN. It will be included in the upcoming v1.6 release.

    Thanks again for the report.

Similar Threads

  1. Replies: 3
    Last Post: May 09, 2012, 4:28 PM
  2. Replies: 2
    Last Post: Apr 23, 2012, 12:47 PM
  3. Replies: 1
    Last Post: Apr 13, 2012, 1:52 PM
  4. [CLOSED] [0.8.2] Date Range - correct month does not open
    By anup in forum 1.x Legacy Premium Help
    Replies: 2
    Last Post: Apr 12, 2010, 11:17 AM
  5. [CLOSED] date field disable
    By speedstepmem4 in forum 1.x Legacy Premium Help
    Replies: 1
    Last Post: May 09, 2009, 2:59 AM

Posting Permissions