RadDateInput Javascript Error

2 posts, 0 answers
  1. David
    David avatar
    1 posts
    Member since:
    Apr 2012

    Posted 20 Apr 2012 Link to this post

    I would like to use the RadDateInput in such a way that it only displays the short month followed by the full year, but only requires the entry of the month number and the short year. For example, a user can input 4/12 and it will display Apr 2012.

    If I do something like:
    <telerik:radDateInput ID="DateInput2"
    DisplayDateFormat="MMM yyyy"
    it throws an error in Javascript "SCRIPT5007: Unable to get value of the property 'Month': object is null or undefined"

    Adding a 'd' somewhere into the DateFormat but keeping the 'MM/yy' first so that it reads something l ike 'MM/yy/d' will work how I want, however, if a user needs to edit a date, clicking into the field changes the text to 04/2012/[today's day number] which is confusing since the only data that is relevant in the field is month and year.

    I find that this error actually gets thrown if you ever omit anything from the DateFormat; having only day and year, only day and month, or only month and year will cause this error to be thrown. Is there any way around this? Or is that a limitation based on the current design of the control?
  2. Jayesh Goyani
    Jayesh Goyani avatar
    2733 posts
    Member since:
    May 2010

    Posted 21 Apr 2012 Link to this post

    Hello David,

    I checked your code and it works correctly.

    my telerik version : Q1 2012

    Jayesh Goyani

Back to Top