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. (Last updated on: June 24, 2019).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Difficulty formatting field date Grid

Thread ID:

Created:

Updated:

Platform:

Replies:

145817 Jul 9,2019 01:50 PM UTC Jul 10,2019 11:03 AM UTC Angular - EJ 2 1
loading
Tags: Grid
Adriano Nascimento
Asked On July 9, 2019 01:50 PM UTC

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

Seeni Sakthi Kumar Seeni Raj [Syncfusion]
Replied On 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. 


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

Live Chat Icon For mobile
Live Chat Icon