I have a kendo grid, it has a date column. I want to show date and time there. I am using below format in column definition,
format: "{0:dd-MMM-yyyy hh:mm:ss tt}"
In modal I used date type Updated_Date: { type: "date" }
Output date is coming as '10-Oct-2013 12:00:00 AM', but actual date returned via ajax call is "Updated_Date":"2013-10-10T05:02:40.44"
What to do to show the correct time in Grid like 10-Oct-2013 05:02:40 AM?
There are two fields that are commonly confused:
So actually you need to define a parseFormat because of the T
between date and time that makes the format not being a default one:
Try:
columns : [
...
{
field : "Date",
title : "Date",
format : "{0:dd-MMM-yyyy hh:mm:ss tt}",
parseFormats: ["yyyy-MM-dd'T'HH:mm:ss.zz"]
}
]
Running example here : http://jsfiddle.net/OnaBai/Ahq6s/
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With