This is a migrated thread and some comments may be shown as answers.
format of date in column of grid
1 Answer 4 Views
This is a migrated thread and some comments may be shown as answers.
Roel
Top achievements
Rank 1
Roel asked on 29 Mar 2021, 12:53 PM

Below code shows how I format the date of a column.

{
    field: "DatumAanvraag",
    title: "Datum aanvraag",
    template: "#= DatumAanvraag ? kendo.toString(kendo.parseDate(DatumAanvraag, 'yyyy-MM-dd'), 'dd-MM-yyyy') : '' #"
},

The model is like this:

DatumAannvraag: { type: "date" },

This works for dates but when I add HH:mm a null is returned.

Any ideas how to optimize this code?

1 Answer, 1 is accepted

Sort by
0
Tsvetomir
Telerik team
answered on 01 Apr 2021, 06:37 AM

Hi Roel,

Since the data field is coming as a "date" data type, then you should be fine with using the format option of the columns instead.

https://docs.telerik.com/kendo-ui/api/javascript/ui/grid/configuration/columns.format

Is it possible for you to share a few rows of the data that come in the grid so that I can try and replicate the described behavior locally? Hence, I will get back to you with specific suggestions targeting your exact case. 

Thank you for your cooperation in advance.

 

Kind regards,
Tsvetomir
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

Tags
Grid
Asked by
Roel
Top achievements
Rank 1
Answers by
Tsvetomir
Telerik team
Share this question
or