Date formatting on the GridColumn

2 posts, 0 answers
  1. Nick
    Nick avatar
    19 posts
    Member since:
    Oct 2019

    Posted 29 Jul 2020 Link to this post

    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?

  2. Stefan
    Admin
    Stefan avatar
    3034 posts

    Posted 29 Jul 2020 Link to this post

    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

Back to Top