We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Grid column dateTime format

Hello,

I'm trying to apply DateTime formatting, but I'm not getting expected output as it shown in documentation.

Expected output: 


Actual output: 


I did reproduce this in one of your demos:




3 Replies

MS Madhu Sudhanan P Syncfusion Team November 30, 2018 04:34 AM UTC

Hi Domantas,  

Thanks for contacting Syncfusion support. 

The format property should be assigned with these objects as follows. 


{ 
        field: 'OrderDate', 
        headerText: 'Order Date', 
        format: { type: 'dateTime', format: 'dd/MM/yyyy hh:mm a' }, 
    } 



Please check the below modified sample. 

  
Regards,  
Madhu Sudhanan P 



IA Imran Asmal February 13, 2020 02:47 PM UTC

Thanks. I did used this format. but after that I got nothing show up. Even no error message. I show it works in your demo. 

Do you have a function template for a column?





BS Balaji Sekar Syncfusion Team February 14, 2020 10:29 AM UTC

Hi Imran, 
 
From validating your query, we suspect that you are maintaining a Date column value as string in your Grid dataSource. For example: when you try to convert the string to date object using new Date() method it will return as invalid date. 
 
Screenshot: 
 
 
So we suggest you to maintain you date column value as Date object in your Grid dataSource to overcome the issue. 
 
If we misunderstood anything wrongly, Please get back us with the following details 
 
  1. Please share your Grid dataSource
  2. Share the Video demonstration of the issue
  3. If possible please reproduce the issue and share the sample.
  4. Share your complete grid rendering code.
 
Regards, 
Balaji Sekar 


Loader.
Live Chat Icon For mobile
Up arrow icon