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

[Solved] DatePicker - Select/Display dates greater than 1/1/2100

1 Answer 15 Views
Date/Time Pickers
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Hemal
Top achievements
Rank 1
Hemal asked on 27 Jul 2011, 07:41 PM
Hi,

I am using DatePicker in my EditorTemplate so every property decorated with DateTime attribute shows DatePicker when user clicks on the field. It works fine and as expected. We have some Date fields in our database which signifies how long is a particular product is valid and we give it a default end date in the future (12/31/2999). Not the best way to do it I know but it's an old system and I can't do much about it now. 
The problem I am having is that the DatePicker throws the following exception when it encounters this date.

Specified argument was out of the range of valid values.
Parameter name: Date should be bigger than MinValue and less then MaxValue

 

Can someone tell me how can I get around this? 

1 Answer, 1 is accepted

Sort by
0
Hemal
Top achievements
Rank 1
answered on 27 Jul 2011, 09:22 PM
Found the answer. Set the .Max("1/1/3100") parameter with the maximum date you that the DatePicker should go to. By Default it displays till 1/1/2010
Tags
Date/Time Pickers
Asked by
Hemal
Top achievements
Rank 1
Answers by
Hemal
Top achievements
Rank 1
Share this question
or