0
votes

have two columns in database

Databse Table

I want to format 'CreatedDate' according to the 'DateFormat' column in a kendo grid. I can use template: "#= kendo.toString(kendo.parseDate(CreatedDate), DateFormat) || '' #", but it wont display correct date format in the date time picker of column filter.

so i'm looking something like this //format: "{ 0:#= DateFormat #}",

code sample --------------------------------------------------- columns: [ { field: "CreatedDate", width: "10%", title: "{{ 'CreatedDate' }}", hidden: true, //format: "{ 0:#= DateFormat #}", }


2

2 Answers

0
votes

You should specify datatype in model. E.g.

dataSource: {
    transport: {
        read: {
            url: "https://demos.telerik.com/kendo-ui/service/tasks",
            dataType: "jsonp"
        },
    },
    schema: {
        model: {
            fields: {
                CreatedDate: { type: "date" }
            }
        }
    }
}

Then on columns,

columns:[
    ...
    { title: "CreatedDate", template:"#=kendo.toString(CreatedDate,DateFormat)#"},
    ...
]
0
votes

this does not change the format of date time picker of filter box this does not change the format of date time picker of filter box