philr
philr

Reputation: 1940

Displaying dates in Kendo Grid

I'm trying to display a simple date with time in a Kendo Grid, but the grid displays my DateTime in the following format: Tue Aug 25 2015 11:35:00 GMT-0400 (Eastern Daylight Time) my date and time are correct, but I would like to remove the time zone from being displayed. Is there a simple way of doing this? Or do I need to convert my date to a string and display my formatted string?

Upvotes: 1

Views: 510

Answers (1)

David Shorthose
David Shorthose

Reputation: 4497

if you look at this demo: grid with formatted date

there is this bit of code in there that is doing the `formatting' of the date

{
    field: "OrderDate",
    title: "Order Date",
    format: "{0:MM/dd/yyyy}"
}, 

you can put any date formatting you want in there.

Please note you will want to ensure your date field is at the top level of your model otherwise you will have to parse the date from a string object to a datetime object.

Without knowing your model structure I will assume it is at the top level.

Upvotes: 5

Related Questions