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

RadDatePicker Client-Side Issue and Invalid Date Format

2 Answers 166 Views
Calendar
This is a migrated thread and some comments may be shown as answers.
David
Top achievements
Rank 1
David asked on 21 Oct 2008, 01:25 PM
Hello,

I have an ASP.NET application written in C# in which I have a RadDatePicker object on the form.  When the user selects a particular menu option the resulting function should get the date from the DatePicker, and pass that date in the URL to the next screen, which is invoked using the RadWindow component.

The problem is that the date being passed contains the following:

"Fri Oct 17 00:00:00 EDT 2008"

This cannot be converted to a DateTime object correctly.

The code within my RadCodeBlock is as follows:

<telerik:RadCodeBlock ID="cb1" runat="server">
    <script language="javascript" type="text/javascript">
         function DisplayStatistics() {
            var picker = $find("<%= RadDatePicker1.ClientID %>");
            var selectedDate = picker.get_selectedDate();
            var oManager = GetRadWindowManager();
            var oWnd = oManager.open("./TradeBlotterStats.aspx?ID=" + selectedDate, "rwBlotterStatistics");
        }
    </script>        
</telerik:RadCodeBlock>

Thanks in advance for any help you can provide,

David Nowak.

2 Answers, 1 is accepted

Sort by
0
Missing User
answered on 22 Oct 2008, 07:15 AM
Hi Dave1,


To see more information on the requested functionality, please refer to the following article:

Kind regards,
Plamen
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Shinu
Top achievements
Rank 2
answered on 22 Oct 2008, 07:52 AM
Hi David,

Try the following code snippet  and see if it helps.

JS:
   var picker = $find("<%= RadDatePicker1.ClientID %>"); 
   var selectedDate = picker.get_selectedDate().toLocaleDateString(); ; 
   alert(selectedDate) 

Regards
Shinu.
Tags
Calendar
Asked by
David
Top achievements
Rank 1
Answers by
Missing User
Shinu
Top achievements
Rank 2
Share this question
or