Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
975
datetime column formating
posted

I would like to format a column (datatype = "datetime") to display the date only. I had tried the following but not working.

headerText: "Date Received", key: "DateReceived", width: "150px", dataType: "datetime", format: "dd/MM/yyyy"
Please help.
Parents
  • 8736
    posted

    Hello,

    You need to set dataType to “date” as shown below:

    {key: "Date Received", headerText: "Date Received", dataType: "date", format: "dd/MM/yyyy" }

    If dataType is "date", then supported formats are following: "date", "dateLong", "dateTime", "time", "timeLong", "MM/dd/yyyy", "MMM-d, yy, h:mm:ss tt", "dddd d MMM", etc.

    Refer to the link below for more details on API:

    https://www.igniteui.com/help/api/2019.1/ui.iggrid

    On the above link, click on the “OPTIONS” tab and expand “columns”  for  more details.

    I hope this helps.

Reply Children