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

Difficulty formatting field date Grid

Hello,
I'm having trouble formatting date field, even using the formats: format="yMd" or format = "M/d/y hh: mm"
nothing works and when I try to put it in the format:
  this.formatoptions = {type: 'dateTime', format: 'M / d / y hh: mm a'}
the data grid is not loaded.

When put to edit and saved the format of the field changes but not being specified.
a sample project modified from the demo follows:
https://ej2.syncfusion.com/angular/demos/#/material/grid/normal-edit

Attachment: jcwza6.run_d64348b2.zip

1 Reply

SS Seeni Sakthi Kumar Seeni Raj Syncfusion Team July 10, 2019 11:03 AM UTC

Hi Adriano,  

Thanks for contacting Syncfusion Support.  

We can reproduce the reported problem at our end. The cause of the problem is datasource bound to the Grid contains the data column with the string values. Grid only formats the values from date object and not from the string. So, we suggest parse the dataSource before binding the Grid using ‘DataUtil.parse.parseJson’ method which is imported from the @syncfusion/ej2-base module. Refer to the following demo.  


Regards,  
Seeni Sakthi Kumar S. 


Loader.
Live Chat Icon For mobile
Up arrow icon