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

timeSlot.get_startTime()

2 Answers 41 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
Scott
Top achievements
Rank 1
Scott asked on 13 Nov 2015, 05:23 PM

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 Answers, 1 is accepted

Sort by
0
Accepted
Veselin Tsvetanov
Telerik team
answered on 18 Nov 2015, 11:06 AM
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.

Regards,
Veselin Tsvetanov
Telerik
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
0
Ranjit
Top achievements
Rank 1
answered on 11 Dec 2015, 05:44 PM

Hello Scott

Please Convert the DateTime With Correct format using Jquery Function .

 

Tags
Scheduler
Asked by
Scott
Top achievements
Rank 1
Answers by
Veselin Tsvetanov
Telerik team
Ranjit
Top achievements
Rank 1
Share this question
or