RadDateInput Set MinDate = DateTime.MinValue Resets MinDate on Postback

15 posts, 1 answers
  1. Dennis
    Dennis avatar
    62 posts
    Member since:
    Oct 2007

    Posted 15 May 2009 Link to this post

    Going back and retesting a previously working piece of code, I now get a different result under version 311 and 402.

    On initial page load, I am setting the MinDate value to "DateTime.MinValue" (or 01/01/0001). This is accepted and works through the UI (accepting dates that far back). But on PostBack, it resets the MinDate to "01/01/2001" instead of keeping my MinDate, which changes the entered value to "01/01/2001" instead of keeping my value. I was using "01/01/1900" as the test date.
     
    I'm not sure when this functionality changed, but it was previously working fine. Is this expected behavior? How do we accept really old dates?

  2. Pavlina
    Admin
    Pavlina avatar
    6084 posts

    Posted 19 May 2009 Link to this post

    Hi Dennis,

    Would you please elaborate a bit more on how would you use this date?
    Please note that the supported min date for more electronic circuit is 1980 and the max date is 2099 unfortunately there is no database which can save date 01/01/0001..

    Kind regards,
    Pavlina
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Dennis
    Dennis avatar
    62 posts
    Member since:
    Oct 2007

    Posted 19 May 2009 Link to this post

    While you are correct, prior to SQL 2008, SQL Server could only go back to 1753. Microsoft added DATETIME2 which goes back to 01/01/01. While 1980 is great as mindate for most people, anyone dealing with "people" as an entity would soon realize that birth dates need to go back further than 1980. Having 1980 as the default minimum date doesn't make a lot sense (it doesn't even match against the SMALLDATETIME).

     

    My purpose for using the built in DateTime.MinDate is that I am too lazy to code my own minimum date throughout the system (primarily). I wouldn't expect to use dates before 1900, but I do need to go back that far. My second use is as an uninitiated date where I don't want to or can't use a NULL value (because I want to simplify access). This occurs in date time segments and again in uninitialized dates (e.g. initial effective date, last paid date) where I don't want to use a NULL.

     

    So, a lot of it is me being lazy in that I don't want to have to worry about the minimum date, but I don't think that makes it any less of a bug. If you accept the DateTime.MinDate as a minimum date when the page is built, and it is used properly when the page is in the browser, the postback should not automatically change my MinDate.

  5. Answer
    Pavlina
    Admin
    Pavlina avatar
    6084 posts

    Posted 20 May 2009 Link to this post

    Hi Dennis,

    Indeed the problem can be observed in the scenario you describe. I have notified  our developers about it and they will investigate it further.

    Sincerely yours,
    Pavlina
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
  6. kieran
    kieran avatar
    19 posts
    Member since:
    Jul 2006

    Posted 29 Jun 2009 Link to this post

    Hi

    Any update this issue? I have come across this issue as well

    Kieran
  7. Pavlina
    Admin
    Pavlina avatar
    6084 posts

    Posted 02 Jul 2009 Link to this post

    Hello Keran,

    Our developers are still working on possible solution. Please excuse us for inconvenience caused. We will let you know when the issue is fixed.

    All the best,
    Pavlina
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
  8. Pavlina
    Admin
    Pavlina avatar
    6084 posts

    Posted 19 Oct 2009 Link to this post

    Hello,

    Our developers already fixed this issue and the fix will be available in the next version release of RadControls for ASP.NET AJAX.

    Thank you for your cooperation.

    Sincerely yours,
    Pavlina
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
  9. iomega 55
    iomega 55 avatar
    64 posts
    Member since:
    Dec 2004

    Posted 02 Feb 2010 Link to this post

    I'm creating runtime a dateinput, but it doesnt accept dates before 1980, how can I configure this for having dates prior to 1980:


                RadDatePicker inputdate = new RadDatePicker(); 
                inputdate.DateInput.DateFormat = "dd/MM/yyyy"
                inputdate.DateInput.EmptyMessage = "fecha"
                inputdate.DateInput.MinDate = new DateTime(1930,1,1); 
                e.EditControl = inputdate; 
     

  10. Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 03 Feb 2010 Link to this post

    Hello,

    You can set the MinDate property of RadDatePicker prior than 1980 to accept the required dates.

    CS:
     
        RadDatePicker inputdate = new RadDatePicker(); 
        inputdate.DateInput.DateFormat = "dd/MM/yyyy"
        inputdate.DateInput.EmptyMessage = "fecha"
        inputdate.DateInput.MinDate = new DateTime(1930, 1, 1); 
        DateTime minDate = new DateTime(1900,1,1); // Set the MinDate as per your requirement - here it set as 1/1/1900
        inputdate.MinDate = minDate; 

    -Shinu.
  11. Kevin
    Kevin avatar
    2 posts
    Member since:
    Nov 2011

    Posted 09 Aug 2012 Link to this post

    I know it was said that this was fixed back in 2009 but I am experiencing the same issue. I have created a new web project just to test this and I found that setting the MinDate to "01/01/0001" causes the value and MinDate to get set to "01/01/2001". As I tested I found that the lowest MinDate that can be set and works is "01/01/0100". Anything below that does not work. Interestingly enough, setting any daye below 01/01/0100 sets yields different values depending on the year. The framework I am using uses the value "01/01/0001" to represent a null datetime.

    Is it possible that this issue has resurfaced back into your latest code?

    Thanks,
    Kevin
  12. Pavlina
    Admin
    Pavlina avatar
    6084 posts

    Posted 14 Aug 2012 Link to this post

    Hello Kevin,

    Can you please specify which is the exact version of RadControls you are using in your application?

    All the best,
    Pavlina
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
  13. Kevin
    Kevin avatar
    2 posts
    Member since:
    Nov 2011

    Posted 14 Aug 2012 Link to this post

    Hi Pavlina,

    I went ahead and created a ticket on this, ticket # 577289. The version we are currently using is 2012.1.215.40.

    Thanks,
    Kevin
  14. Pavlina
    Admin
    Pavlina avatar
    6084 posts

    Posted 14 Aug 2012 Link to this post

    Hello,

    Indeed the described problem persists. This bug seems to be introduced in Q2 2012 version of RadControls for ASP.NET AJAX. I already logged it in our in our bug tracking system. Here you can find the PITS Issue: Public URL .

    Greetings,
    Pavlina
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
  15. Viral
    Viral avatar
    1 posts
    Member since:
    Mar 2016

    Posted 09 Mar in reply to Shinu Link to this post

    Hi,

    I am using the below code, but it wont set my min date.

     

    Can you please let me know how do i fix it?

     

    RadDatePicker radDatePicker = new RadDatePicker();
                                        radDatePicker.ID = "radDatePicker_" + promotionID.ToString() + "_" + dr["S" + s.ForeignID + "_SecondaryRefID"] + "_" + todo.ToDoID.ToString();
                                        radDatePicker.SharedCalendarID = "SharedCalendar";
                                        radDatePicker.Width = new Unit(20);
                                        radDatePicker.Skin = "Modern";   //made changes to Calendar.css file from the Default skin folder
                                        radDatePicker.RadControlsDir = "~/RadControls/";
                                        radDatePicker.DateInput.Style["display"] = "none";
                                        radDatePicker.DateInput.DateFormat = "dd/MM/yyyy";
                                        radDatePicker.FocusedDate = m_Date;
                                        radDatePicker.SelectedDate = m_Date;
                                        radDatePicker.Calendar.EnableMultiSelect = false;
                                        radDatePicker.Calendar.UseColumnHeadersAsSelectors = false;
                                        radDatePicker.ClientEvents.OnDateSelected = "RadDatePicker_DateSelected";
                                        DateTime Mindate1 = new DateTime(1990, 1, 1); // Added by Viral for WWRS-30
                                        radDatePicker.MinDate = Mindate1;
                                       
                                        m_Cell.Controls.Add(radDatePicker);

  16. Pavlina
    Admin
    Pavlina avatar
    6084 posts

    Posted 14 Mar Link to this post

    Hi Viral,

    I have noticed that you have opened support ticket with the same question which is already answered. In order to avoid multiple posts I will ask you to continue your communication there.

    Regards,
    Pavlina
    Telerik
    Do you need help with upgrading your ASP.NET AJAX, WPF or WinForms projects? Check the Telerik API Analyzer and share your thoughts.
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017