This is a migrated thread and some comments may be shown as answers.

RadDateInput Set MinDate = DateTime.MinValue Resets MinDate on Postback

14 Answers 443 Views
Input
This is a migrated thread and some comments may be shown as answers.
Dennis
Top achievements
Rank 1
Dennis asked on 15 May 2009, 04:10 PM
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?

14 Answers, 1 is accepted

Sort by
0
Pavlina
Telerik team
answered on 19 May 2009, 01:01 PM
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.
0
Dennis
Top achievements
Rank 1
answered on 19 May 2009, 04:28 PM

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.

0
Accepted
Pavlina
Telerik team
answered on 20 May 2009, 09:42 AM
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.
0
kieran
Top achievements
Rank 1
answered on 29 Jun 2009, 05:41 PM
Hi

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

Kieran
0
Pavlina
Telerik team
answered on 02 Jul 2009, 02:22 PM
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.
0
Pavlina
Telerik team
answered on 19 Oct 2009, 02:23 PM
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.
0
iomega 55
Top achievements
Rank 1
answered on 03 Feb 2010, 05:09 AM
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; 
 

0
Shinu
Top achievements
Rank 2
answered on 03 Feb 2010, 11:08 AM
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.
0
Kevin
Top achievements
Rank 1
answered on 09 Aug 2012, 12:32 PM
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
0
Pavlina
Telerik team
answered on 14 Aug 2012, 12:20 PM
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.
0
Kevin
Top achievements
Rank 1
answered on 14 Aug 2012, 12:44 PM
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
0
Pavlina
Telerik team
answered on 14 Aug 2012, 07:57 PM
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.
0
Viral
Top achievements
Rank 1
answered on 09 Mar 2016, 10:43 PM

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);

0
Pavlina
Telerik team
answered on 14 Mar 2016, 09:47 PM
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.
Tags
Input
Asked by
Dennis
Top achievements
Rank 1
Answers by
Pavlina
Telerik team
Dennis
Top achievements
Rank 1
kieran
Top achievements
Rank 1
iomega 55
Top achievements
Rank 1
Shinu
Top achievements
Rank 2
Kevin
Top achievements
Rank 1
Viral
Top achievements
Rank 1
Share this question
or