This is a migrated thread and some comments may be shown as answers.

Date formatting on the GridColumn

1 Answer 33 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Nick
Top achievements
Rank 1
Veteran
Nick asked on 29 Jul 2020, 06:12 AM

I have a date field on my class, displays the data using the below GridColumn, but, I cannot get it to format the date string, no matter what I do I always seem to get 2020-07-31T00:00:00

<GridColumn
                field="del_Date"
                title="Del Date"
                width="150px"
                editable={false}
                filter="date" 
                format="{0:D/M/YY}"
              />

 

I have followed the documentation and the above seems to be correct, what could I be doing wrong?

1 Answer, 1 is accepted

Sort by
0
Stefan
Telerik team
answered on 29 Jul 2020, 06:59 AM

Hello, Nick,

Thank you for the code.

This could occur if the date is a string instead of a valid Date object as the Grid will apply the format only if the value is a date object.

More information and possible solutions are listed here:

https://www.telerik.com/kendo-react-ui/knowledge-base/grid-date-format/

Regards,
Stefan
Progress Telerik

Tags
General Discussions
Asked by
Nick
Top achievements
Rank 1
Veteran
Answers by
Stefan
Telerik team
Share this question
or