Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Web Controls > Calendar Control: Breaks if set to December 9999

Thread Tools

Calendar Control: Breaks if set to December 9999

Nathan Pickett
Posts: n/a

The following exception is being throw when I set the ASP.NET Calendar
control to December 1, 9999 (end of time):

Specified argument was out of the range of valid values. Parameter name:
Year, Month, and Day parameters describe an unrepresentable DateTime.

I believe that this is because when the control renders the title, the value
for the navigation's next month is not a valid DateTime since it is greater
than the DateTime.MaxValue (23:59:59.9999999, December 31, 9999).

To resolve this issue I am currently using Regular Expressions to validate
the input for the intial date. If the date is greater than December 9999 ,
I am assigning the Calendar's TodaysDate property to November, 30 9999 in
the Page_Load. I am also doing this check in VisibleMonthChanged event.
This disallows the Calendar to render a view greater than November 9999.

It would make more sense to the user if the next month navigation is disable
or removed from the title navigation for December 9999. Is there a way to
prevent the next month navigation element from rendering if the date is
December 9999? Preferable without extending the Calendar control.

Thanks! -Nate

Reply With Quote

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
File::Slurp 9999.14 is released Uri Guttman Perl Misc 4 03-23-2011 08:07 PM
Calendar Control: Exception with December 9999 Date Nathan Pickett ASP .Net Web Controls 1 02-28-2004 08:13 PM
re configure data adapter (9999) not =?Utf-8?B?c2ltb24=?= ASP .Net 0 01-23-2004 05:11 PM
Printing dialog shows 9999 pages to print JavaRookie Java 4 10-13-2003 11:58 AM
DTD Validation Error: Attribute Value "9999" of type ID must be aname. Marcio DeBarros XML 2 10-02-2003 04:30 PM