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

DateTimePicker grid item not passing properly in AJAX post

2 Answers 48 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Sean
Top achievements
Rank 1
Sean asked on 23 Jan 2013, 04:04 PM
I am doing a manual Jquery.Ajax post as my screen has data outside the grid that has to be posted to the Action.

I am able to do an Jquery.each to populate the model from the grid.dataSource.data, but even if I do a date.toUTCString() the HttpPost Action receives the date incorrectly after I do a JSON.stringify(model) in the Ajax post.

From Jquery AJAX post in View: 
1/25/2013 (resolved to "Fri, 25 Jan 2013 05:00:00 GMT" with the .toUTCstring())
NOTE: I did try this without a .toUTCstring pior, as well as .toDateString()

Resolved To Controller Action: 
{1/23/2013 11:01:57 AM}

Has anyone encountered something like this? If so, how have you resolved it?

2 Answers, 1 is accepted

Sort by
0
Accepted
Petur Subev
Telerik team
answered on 25 Jan 2013, 08:58 AM
Hello Sean,

I assume that you experience the same issue as the one which is solved in this demo. The case is not just the same as yours but it could give you an idea to find a solution.

Kind Regards,
Petur Subev
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
Sean
Top achievements
Rank 1
answered on 25 Jan 2013, 04:31 PM
Thanks, Peter, it IS passing the date into the Action now.

We're just losing 5 hours after submission, but that is probably something on our end when somewhere the service is implicitly converting back to localtime.

Thanks again for the follow-up.
Tags
Grid
Asked by
Sean
Top achievements
Rank 1
Answers by
Petur Subev
Telerik team
Sean
Top achievements
Rank 1
Share this question
or