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

radcalendat shows a date on entering 12000

3 Answers 57 Views
Calendar
This is a migrated thread and some comments may be shown as answers.
Nimish Gupta
Top achievements
Rank 1
Nimish Gupta asked on 01 Apr 2010, 08:41 AM
Hi,

I have a radcalendar, which is user typeable.

Upon typing a number like 120000 it takes the date as 12-Dec-1998.

When i type just 12 , it takes the date as 12 + current Month + current Year

When i type the 1200 it does not change anything

What is reason that it takes this date. How can I stop the auto intelligence of the calendar control.

Sample rad calendar decalration used :

<

 

radCln:RadDatePicker ID="rdTransactionStartDate" runat="server">

 

 

<DateInput Skin="None" DateFormat="dd-MMM-yyyy">

 

 

</DateInput>

 

 

<Calendar Skin="Office2007" ShowOtherMonthsDays="False" FastNavigationPrevToolTip="Previous Year"

 

 

FastNavigationNextToolTip="Next Year" NavigationNextToolTip="Next Month" NavigationPrevToolTip="Previous Month"

 

 

FastNavigationStep="12" ShowRowHeaders="false">

 

 

</Calendar>

 

 

<DatePopupButton CssClass="mLeft10" />

 

 

</radCln:RadDatePicker>

 

3 Answers, 1 is accepted

Sort by
0
Daniel
Telerik team
answered on 01 Apr 2010, 08:21 PM
Hello Nimish,

You can disable the built-in parsing (when using RadControls for ASP.NET AJAX only) this way:
<script type="text/javascript">   
    Telerik.Web.UI.RadDateInput.prototype.parseDate = function(value, baseDate)   
    {   
        if (new Date(value) != "NaN")   
            return value;   
    }   
</script>

Regards,
Daniel
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
0
Nimish Gupta
Top achievements
Rank 1
answered on 06 Apr 2010, 11:58 AM
Hey Daniel,

Thanks for the answer, but I cannot figure out how to use it with my date picker control on the asp.net page.
Can you send the exact piece of code.

Thanks,
Nimish
0
Daniel
Telerik team
answered on 09 Apr 2010, 02:28 PM
Hello Nimish Gupta,

This is the whole markup:
<body>
    <form id="form1" runat="server">
    <asp:ScriptManager ID="ScriptManager1" runat="server" />
 
    <script type="text/javascript">
        Telerik.Web.UI.RadDateInput.prototype.parseDate = function(value, baseDate)
        {
            if (new Date(value) != "NaN")
                return value;
        }  
    </script>
    <telerik:RadDatePicker ID="RadDatePicker1" runat="server" />
    </form>
</body>

Regards,
Daniel
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
Tags
Calendar
Asked by
Nimish Gupta
Top achievements
Rank 1
Answers by
Daniel
Telerik team
Nimish Gupta
Top achievements
Rank 1
Share this question
or