1

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'

2 Answers 2

1

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;
        })
Sign up to request clarification or add additional context in comments.

Comments

0

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

6 Comments

are you sure? this works perfectly in mine and has done for a while now?
Why do you think I post?
are you sure it is compiling? do you get any errors in the console?
It does transpile and there are no errors in the console. Note that format for a number works, the issue is just with dates.
so should mine ('d' is a valid format for a date)... hence my post.
|

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.