Get SelectedDate from RadDatePicker

2 posts, 1 answers
  1. Johnny
    Johnny avatar
    86 posts
    Member since:
    Dec 2010

    Posted 13 Jul 2011 Link to this post

    hi i get the SelectedDate of RadDatePicker from javasctipt OnDateSelectedevent in following format
     "Wed Jul 6 00:00:00 UTC+0800 2011"
    when i try to convert this string to Date i getting the following  error
    Conversion from string "Wed Jul 6 00:00:00 UTC+0800 2011" to type 'Date' is not valid.
    how to solve this
  2. Answer
    Princy
    Princy avatar
    17421 posts
    Member since:
    Mar 2007

    Posted 13 Jul 2011 Link to this post

    Hello Johnny,

    You can use the following client side code to get the correct date.

    ClientSide:
    function OnDateSelected(Sender, e)
        {
            alert("OnDateSelected: " + e.get_newDate().toDateString());
        }

    Thanks,
    Princy.
Back to Top