I am trying to show a datetime column appropriately in my Kendo UI Grid. Date is being shown successfully, but not time. Here's a simple jsfiddle showing my scenario.
field: "Date",
title: "Date",
format: "{0:dd-MMM-yyyy hh:mm:ss tt}",
parseFormats: ["MM/dd/yyyy h:mm:ss"]
I have tried different alternatives with no success. Any thoughts on how to show the content as expected would be greatly appreciated!
Use template:
{
field: "Date"
, title: "Date"
, width: "100px"
, template: "#= (Date == null)? '' : kendo.toString(kendo.parseDate(Date, 'yyyy-MM-dd'), 'MM/dd/yy') #"
},
datatype you specified for date field is date type.it should be datetime as shown in the below
fields: {
Id: { type: 'number' },
FirstName: { type: 'string' },
LastName : { type: 'string' },
Date: { type: 'datetime' }
}
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