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
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.
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.
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.
Any update this issue? I have come across this issue as well
Kieran
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.
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.
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; |
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.
Is it possible that this issue has resurfaced back into your latest code?
Thanks,
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
I went ahead and created a ticket on this, ticket # 577289. The version we are currently using is 2012.1.215.40.
Thanks,
Kevin
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
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);
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