Welcome Guest Search | Active Topics | Sign In | Register

Datepicker returning date outside of MinValidDate Options
Code Monkey
Posted: Monday, April 21, 2008 6:04:25 PM
Rank: Advanced Member
Groups: Member

Joined: 2/11/2008
Posts: 37
Using build 44 I have found that a DatePicker will return a date prior to the current MinValidDate.

An example scenario is you select a date in the datepicker, then click a button which causes postback and in the server-side you set the MinValidDate to a date that comes after the date you picked manually. Then after postback the datepicker looks like it has the MinValidDate selected but if you clicked another button which displayed the SelectedDate value, it will be the previously-selected value.

So basically I can make the DatePicker return '04/09/2008' for SelectedDate even though the MinValidDate was set to '04/21/2008'.
eo_support
Posted: Tuesday, April 22, 2008 4:24:49 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,090
Hi,

Thanks for the information. We looked into the issue and we are still considering how or whehter to change it. The root of the problem is that you can programmatically set SelectedDate to be outside of MinValidDate and MaxValidDate. For example:

Code: C#
DatePicker1.SelectedDate = DateTime.Today;
DatePicker1.MinValidDate = DateTime.Today.AddDays(1);


The DatePicker will take it literally as it is without adjusting SelectedDate automatically. The reason that it was implemented this way is that we were concern about implicit operations on our side confuses user. However in your case what the user sees is not what the real value of the DatePicker. So that is certainly a concern as well.

Thanks


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.