3 posts, 1 answers
  1. Scott
    Scott avatar
    7 posts
    Member since:
    Oct 2015

    Posted 13 Nov 2015 Link to this post

    The given javascript function returns date in the following format:

    Thu Nov 12 2015 00:00:00 GMT-0500 (Eastern Standard Time)


    That output fails DateTime.TryParse. Is there any way to get the timeSlot.get_startTime() to return a simpler date format, or a way to parse that output into a Date object? 


    Thank you

  2. Answer
    Veselin Tsvetanov
    Veselin Tsvetanov avatar
    242 posts

    Posted 18 Nov 2015 Link to this post

    Hello Scott,

    I would suggest you to first format the JavaScript Date object and then parse the string result with DateTme.TryParse. Here is an example of getting the startDate in the OnClientAppointmentInserting event handler:

    function OnClientAppointmentInserting(sender, eventArgs) {
        var startDate = eventArgs.get_startTime();
        var dateString = startDate.format("yyyy/MM/dd hh:mm");

    Then you can pass the dateString to be parsed using DateTme.TryParse.

    Veselin Tsvetanov
    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 Feedback Portal and vote to affect the priority of the items
  3. DevCraft R3 2016 release webinar banner
  4. Ranjit
    Ranjit avatar
    1 posts
    Member since:
    Oct 2015

    Posted 11 Dec 2015 Link to this post

    Hello Scott

    Please Convert the DateTime With Correct format using Jquery Function .


Back to Top