RadControls for ASP .NET AJAX version |
2008.3.1105 and later
|
.NET version |
2.0 and later
|
Visual Studio version |
2005 and later
|
Programming language |
Javascript, C#
|
Browser support |
all browsers supported by RadControls
|
PROJECT DESCRIPTION
Some client scenarios may require the embedded
RadDateInput to be formatted with "
MM/yyyy" date format. This is not a problem if the user enters a full date value (day,month,year). However, if the value contains only "month" and "year" parts (e.g "05/2010"), the embedded parsing mechanism of the
RadDateInput control will parse the "month" part as a day and apply the current month to form the final date.
This help topic provides more details about how
RadDateInput parsing works.
In order to avoid the built-in parsing the developper must construct the date manually before it is applied to the input. As stated above this should be done only if the entered date misses its "day" part. The most appropriate approach to do that is to use the client side
OnValueChanging event. The exact implementation is demonstrated in the attached sample project.
Note:
The demonstrated implementation could be considerably simplified if the developer knows in advance the exact date format that the user is expected to use. Currently the project allows different date formats and date separators which requires some additional Javascript coding.