Get the date value in javascript that is convertable to .Net DateTime

1 Answer 2331 Views
Date/Time Pickers
StevenDale
Top achievements
Rank 2
StevenDale asked on 04 Jul 2013, 05:01 AM
Using 2013.1.514.340

When I get the value of a datepicker control in javascript it is return in the following format example: Thu Jul 4 00:00:00 CDT 2013. When I try to use DateTime.Parse to get the .Net Date it returns false. Is there a way to get a value from the DatePicker that is convertible to a .Net DateTime?

Thanks,

Billy Jacobs

1 Answer, 1 is accepted

Sort by
0
Accepted
StevenDale
Top achievements
Rank 2
answered on 04 Jul 2013, 05:18 AM
I figured it out:
function getParameter() {                      
        return {
 
            startDate: kendo.toString($("#StartDatePicker").data("kendoDatePicker").value(), 'd'),
            endDate: kendo.toString($("#EndDatePicker").data("kendoDatePicker").value(), 'd')
 
        };
    }
Rob
Top achievements
Rank 1
commented on 02 Nov 2017, 09:39 PM

Looks like you are using jQuery?

Try this:

function getParameter() {                     
        return {
  
            startDate: $("#StartDatePicker").val(),
            endDate: $("#EndDatePicker").val()
  
        };
    }
Tags
Date/Time Pickers
Asked by
StevenDale
Top achievements
Rank 2
Answers by
StevenDale
Top achievements
Rank 2
Share this question
or