François
François

Reputation: 3274

Kendo UI - Angular - Formatting a date column

I'm trying a simple thing as displaying a date column in a kendo ui grid in Angular using the following:

<kendo-grid-column field="date" title="Date" type="date" format="{0:d}"></kendo-grid-column>

However the result is:

'2017-04-30T09:00:00'

Upvotes: 1

Views: 2200

Answers (2)

T_T
T_T

Reputation: 583

I guess you are using the data received from your backend. It that case your should convert your date field to Date type manually.

return this.http.get("url")
        .map((res: Response) => {
            let result = res.json();
            result.forEach((x) => {
                x.dateField= new Date(x.dateField);
            });

            return result;
        })

Upvotes: 1

mast3rd3mon
mast3rd3mon

Reputation: 8825

Use the following in place of your format code: format="{0:dd/MM/yyyy}". You have to specify which format you wish to use

Upvotes: 0

Related Questions