BoldSignEasily embed eSignatures in your .NET applications. Free sandbox with native SDK available.
Hi Mahyar,
Thanks for contacting syncfusion support. We are happy to
assist you.
Query: I need to show
exactly the string date as it has retrieved from json
To achieve your requirement we suggest you to define the
type as “date” in the column definition and also you can specific the desire
format using format property. Refer the below code example,
@(Html.EJ().Grid<object>("testGrid") ………….. .Columns(col => {
col.Field("OrderID").IsPrimaryKey(true).Add();
col.Field("OrderDate").HeaderText("OrderDate").Type("date").Format("{0:yyyy-MM-dd}").Add(); }) ) |
Also refer the below link for help documentation,
https://help.syncfusion.com/aspnetmvc/grid/columns#type
https://help.syncfusion.com/aspnetmvc/grid/columns#format
Regards,
Manivannan Padmanaban.
<script>
ej.dateParse = false;
</script> |
JSON itself does not specify how dates should be represented, but JavaScript does. What .NET does is a non-standard hack/extension. The problem with JSON date and really JavaScript in general – is that there’s no equivalent literal representation for dates. In JavaScript following Date constructor straight away converts the milliseconds since 1970 to Date as follows:
var jsonDate = new Date(1297246301973);
Then let’s convert it to js format:
var date = new Date(parseInt(jsonDate.substr(6)));
The substr() function takes out the /Date( part, and the parseInt() function gets the integer and ignores the )/ at the end. The resulting number is passed into the Date constructor .
For ISO-8601 formatted JSON dates, just pass the string into the Date constructor:
var date = new Date(jsonDate);