)
We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: June 24, 2019).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Date fields in JSON data are not formatted properly in ajax post

Platform: ASP.NET MVC |
Control: Grid |
Published Date: December 10, 2014 |
Last Revised Date: August 5, 2015 |
.NET Framework: 4.5.1

Problem

The date column value is obtained in the format “\ /Date(628318530718)\/.

Cause

The date value is not formatted when it is retrieved from the server via AJAX post.

Solution

The unformatted JSON date value can be formatted by ej.parseJSON function in the AJAX success event.

JS

 

2X faster development

The ultimate ASP.NET MVC UI toolkit to boost your development speed.
ADD COMMENT
You must log in to leave a comment
Comments
Steve Taylor
Sep 15, 2016
How do you handle Time Zones in the ej.parseJSON function?  I'm getting an issue because my dates are off by a couple of hours. Reply
Alan Sangeeth S [Syncfusion]
Dec 27, 2016

Hi Steve,


To resolve the issue with Time zones, you can use the ej.serverTimezoneOffset. Please refer the following UG documentation for this helper function

 

https://help.syncfusion.com/js/datamanager/helper-functions

 

Note: In the above documentation, we have a typo error, that ‘z’ in serverTimezoneoffset is mistakenly capitalized and it should be in smaller case “ej.serverTimezoneOffset”. We will update this correction and it will be refreshed online soon.

 

Regards,
Alan Sangeeth S 

Reply
Mangala
Jan 04, 2017
Hi, 

I am facing same issue. But when I am trying to use the above code for parsing the data, it says 'ej is not defined'. Is there any reference jquery file to be used? Why it is not working for me?
Reply

Please sign in to access our KB

This page will automatically be redirected to the sign-in page in 10 seconds.

Up arrow icon

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

Live Chat Icon For mobile
Live Chat Icon