Articles in this section
Category / Section

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

1 min read

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

<script type="text/javascript">
function ajxajaxMethod() {
$.ajax({
type: "POST",
url: "Grid/JsonData/",
contentType: "application/json; charset=utf-8",
dataType:"json",
success: function (data) {
var formatData = ej.parseJSON(data);
} 
});
}
</script>

 

Did you find this information helpful?
Yes
No
Help us improve this page
Please provide feedback or comments
Comments
Please sign in to leave a comment
Access denied
Access denied